Fix TODO bug for maximized windows across restarts.

SVN revision: 15717
This commit is contained in:
rbdpngn 2005-07-10 17:12:01 +00:00 committed by rbdpngn
parent 741602cc85
commit 6b57b60733
6 changed files with 61 additions and 11 deletions

1
TODO
View File

@ -27,7 +27,6 @@ Some of the things (in very short form) that need to be done to E17...
* BUG: sometimes the mouse gets locked to a window with a mouse grab of some
sort in x (it gets the down event and not the up?) so e thinks its down but
it isn't - happens a lot in click to focus.
* BUG: maximised apps when e restarts are not recognised as maximised
* BUG: client windows list somehow doesn't unref its list of borders in the
free callback set on it. why? is this callback never called? or is the
data pointer on the menu object null for some reason?

View File

@ -11,6 +11,7 @@ Ecore_X_Atom E_ATOM_DESK = 0;
Ecore_X_Atom E_ATOM_MAPPED = 0;
Ecore_X_Atom E_ATOM_SHADE_DIRECTION = 0;
Ecore_X_Atom E_ATOM_HIDDEN = 0;
Ecore_X_Atom E_ATOM_SAVED_SIZE = 0;
/* externally accessible functions */
int
@ -23,7 +24,8 @@ e_atoms_init(void)
E_ATOM_MAPPED = ecore_x_atom_get("__E_WINDOW_MAPPED");
E_ATOM_SHADE_DIRECTION = ecore_x_atom_get("__E_WINDOW_SHADE_DIRECTION");
E_ATOM_HIDDEN = ecore_x_atom_get("__E_WINDOW_HIDDEN");
E_ATOM_SAVED_SIZE = ecore_x_atom_get("__E_WINDOW_SAVED_SIZE");
return 1;
}

View File

@ -16,6 +16,7 @@ extern EAPI Ecore_X_Atom E_ATOM_DESK;
extern EAPI Ecore_X_Atom E_ATOM_MAPPED;
extern EAPI Ecore_X_Atom E_ATOM_SHADE_DIRECTION;
extern EAPI Ecore_X_Atom E_ATOM_HIDDEN;
extern EAPI Ecore_X_Atom E_ATOM_SAVED_SIZE;
EAPI int e_atoms_init(void);
EAPI int e_atoms_shutdown(void);

View File

@ -1110,10 +1110,14 @@ e_border_maximize(E_Border *bd, E_Maximize max)
int w, h;
// printf("MAXIMIZE!!\n");
bd->saved.x = bd->x;
bd->saved.y = bd->y;
bd->saved.w = bd->w;
bd->saved.h = bd->h;
if (!bd->saved.x && !bd->saved.y && !bd->saved.w && !bd->saved.h)
{
bd->saved.x = bd->x;
bd->saved.y = bd->y;
bd->saved.w = bd->w;
bd->saved.h = bd->h;
e_hints_window_saved_size_set(bd, bd->x, bd->y, bd->w, bd->h);
}
e_border_raise(bd);
switch (max)
@ -1254,6 +1258,8 @@ e_border_unmaximize(E_Border *bd)
bd->maximized = E_MAXIMIZE_NONE;
e_border_move_resize(bd, bd->saved.x, bd->saved.y, bd->saved.w, bd->saved.h);
bd->saved.x = bd->saved.y = bd->saved.w = bd->saved.h = 0;
e_hints_window_saved_size_set(bd, 0, 0, 0, 0);
edje_object_signal_emit(bd->bg_object, "unmaximize", "");
}
@ -1275,10 +1281,15 @@ e_border_fullscreen(E_Border *bd)
{
int x, y, w, h;
// printf("FULLSCREEEN!\n");
bd->saved.x = bd->x;
bd->saved.y = bd->y;
bd->saved.w = bd->w;
bd->saved.h = bd->h;
if (!bd->saved.x && !bd->saved.y && !bd->saved.w && !bd->saved.h)
{
bd->saved.x = bd->x;
bd->saved.y = bd->y;
bd->saved.w = bd->w;
bd->saved.h = bd->h;
e_hints_window_saved_size_set(bd, bd->x, bd->y, bd->w, bd->h);
}
bd->client_inset.sl = bd->client_inset.l;
bd->client_inset.sr = bd->client_inset.r;
bd->client_inset.st = bd->client_inset.t;

View File

@ -398,7 +398,10 @@ e_hints_window_init(E_Border *bd)
if (bd->client.netwm.state.shaded)
e_border_shade(bd, e_hints_window_shade_direction_get(bd));
if ((bd->client.netwm.state.maximized_v) && (bd->client.netwm.state.maximized_h))
e_border_maximize(bd, e_config->maximize_policy);
{
e_hints_window_saved_size_get(bd, &bd->saved.x, &bd->saved.y, &bd->saved.w, &bd->saved.h);
e_border_maximize(bd, e_config->maximize_policy);
}
if (bd->client.netwm.state.fullscreen)
e_border_fullscreen(bd);
if ((bd->client.icccm.state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
@ -994,6 +997,35 @@ e_hints_window_shade_direction_get(E_Border *bd)
return E_DIRECTION_UP;
}
void
e_hints_window_saved_size_set(E_Border *bd, int x, int y, int w, int h)
{
unsigned int sizes[4];
sizes[0] = x;
sizes[1] = y;
sizes[2] = w;
sizes[3] = h;
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_SAVED_SIZE, sizes, 4);
}
int
e_hints_window_saved_size_get(E_Border *bd, int *x, int *y, int *w, int *h)
{
int ret;
int sizes[4];
memset(sizes, 0, sizeof(sizes));
ret = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_SAVED_SIZE,
sizes, 4);
if (x) *x = sizes[0];
if (y) *y = sizes[1];
if (w) *w = sizes[2];
if (h) *h = sizes[3];
return ret;
}
void
e_hints_window_maximized_set(E_Border *bd, int on)
{

View File

@ -30,6 +30,11 @@ EAPI void e_hints_window_hidden_set(E_Border *bd);
EAPI void e_hints_window_shade_direction_set(E_Border *bd, E_Direction dir);
EAPI E_Direction e_hints_window_shade_direction_get(E_Border *bd);
EAPI void e_hints_window_saved_size_set(E_Border *bd,
int x, int y, int w, int h);
EAPI int e_hints_window_saved_size_get(E_Border *bd,
int *x, int *y, int *w, int *h);
EAPI void e_hints_window_shaded_set(E_Border *bd, int on);
EAPI void e_hints_window_maximized_set(E_Border *bd, int on);
EAPI void e_hints_window_fullscreen_set(E_Border *bd, int on);