* 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?
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
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;
}
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);
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)
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", "");
}
{
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;
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)
}
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)
{
if ((!bd->client.netwm.state.maximized_v) && (on))
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);