Enlightenment CVS committal Author : rbdpngn Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_atoms.c e_atoms.h e_border.c e_hints.c e_hints.h Log Message: Fix TODO bug for maximized windows across restarts. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_atoms.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_atoms.c 28 May 2005 13:22:14 -0000 1.10 +++ e_atoms.c 10 Jul 2005 17:12:01 -0000 1.11 @@ -11,6 +11,7 @@ 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_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; } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_atoms.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_atoms.h 12 May 2005 08:50:52 -0000 1.10 +++ e_atoms.h 10 Jul 2005 17:12:01 -0000 1.11 @@ -16,6 +16,7 @@ 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); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.324 retrieving revision 1.325 diff -u -3 -r1.324 -r1.325 --- e_border.c 10 Jul 2005 10:48:07 -0000 1.324 +++ e_border.c 10 Jul 2005 17:12:01 -0000 1.325 @@ -1110,10 +1110,14 @@ 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 @@ 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 @@ { 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; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_hints.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -3 -r1.56 -r1.57 --- e_hints.c 4 Jul 2005 10:24:22 -0000 1.56 +++ e_hints.c 10 Jul 2005 17:12:01 -0000 1.57 @@ -398,7 +398,10 @@ 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) @@ -995,6 +998,35 @@ } 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)) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_hints.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- e_hints.h 3 Jun 2005 16:35:29 -0000 1.17 +++ e_hints.h 10 Jul 2005 17:12:01 -0000 1.18 @@ -30,6 +30,11 @@ 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); ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs