forked from enlightenment/enlightenment
parent
d5332fa337
commit
2bbeab6519
|
@ -11,7 +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;
|
||||
Ecore_X_Atom E_ATOM_BORDER_SIZE = 0;
|
||||
|
||||
/* externally accessible functions */
|
||||
int
|
||||
|
@ -24,7 +24,7 @@ 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");
|
||||
E_ATOM_BORDER_SIZE = ecore_x_atom_get("__E_WINDOW_BORDER_SIZE");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -16,7 +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;
|
||||
extern EAPI Ecore_X_Atom E_ATOM_BORDER_SIZE;
|
||||
|
||||
EAPI int e_atoms_init(void);
|
||||
EAPI int e_atoms_shutdown(void);
|
||||
|
|
|
@ -1136,15 +1136,11 @@ e_border_maximize(E_Border *bd, E_Maximize max)
|
|||
int x1, y1, x2, y2;
|
||||
int w, h;
|
||||
|
||||
// printf("MAXIMIZE!!\n");
|
||||
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->saved.x = bd->x;
|
||||
bd->saved.y = bd->y;
|
||||
bd->saved.w = bd->w;
|
||||
bd->saved.h = bd->h;
|
||||
e_hints_window_size_set(bd);
|
||||
|
||||
e_border_raise(bd);
|
||||
switch (max)
|
||||
|
@ -1286,7 +1282,7 @@ e_border_unmaximize(E_Border *bd)
|
|||
|
||||
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);
|
||||
e_hints_window_size_unset(bd);
|
||||
|
||||
edje_object_signal_emit(bd->bg_object, "unmaximize", "");
|
||||
}
|
||||
|
@ -1307,15 +1303,12 @@ e_border_fullscreen(E_Border *bd)
|
|||
if (!bd->fullscreen)
|
||||
{
|
||||
int x, y, w, h;
|
||||
// printf("FULLSCREEEN!\n");
|
||||
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->saved.x = bd->x;
|
||||
bd->saved.y = bd->y;
|
||||
bd->saved.w = bd->w;
|
||||
bd->saved.h = bd->h;
|
||||
e_hints_window_size_set(bd);
|
||||
|
||||
bd->client_inset.sl = bd->client_inset.l;
|
||||
bd->client_inset.sr = bd->client_inset.r;
|
||||
|
@ -1344,6 +1337,7 @@ e_border_fullscreen(E_Border *bd)
|
|||
bd->fullscreen = 1;
|
||||
|
||||
e_hints_window_fullscreen_set(bd, 1);
|
||||
e_hints_window_size_unset(bd);
|
||||
edje_object_signal_emit(bd->bg_object, "fullscreen", "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -399,12 +399,12 @@ e_hints_window_init(E_Border *bd)
|
|||
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_hints_window_saved_size_get(bd);
|
||||
e_hints_window_size_get(bd);
|
||||
e_border_maximize(bd, e_config->maximize_policy);
|
||||
}
|
||||
if (bd->client.netwm.state.fullscreen)
|
||||
{
|
||||
e_hints_window_saved_size_get(bd);
|
||||
e_hints_window_size_get(bd);
|
||||
e_border_fullscreen(bd);
|
||||
}
|
||||
if ((bd->client.icccm.state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
|
||||
|
@ -909,32 +909,41 @@ e_hints_window_shade_direction_get(E_Border *bd)
|
|||
}
|
||||
|
||||
void
|
||||
e_hints_window_saved_size_set(E_Border *bd)
|
||||
e_hints_window_size_set(E_Border *bd)
|
||||
{
|
||||
unsigned int sizes[4];
|
||||
|
||||
sizes[0] = bd->saved.x;
|
||||
sizes[1] = bd->saved.y;
|
||||
sizes[2] = bd->saved.w;
|
||||
sizes[3] = bd->saved.h;
|
||||
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_SAVED_SIZE, sizes, 4);
|
||||
sizes[0] = bd->x;
|
||||
sizes[1] = bd->y;
|
||||
sizes[2] = bd->w;
|
||||
sizes[3] = bd->h;
|
||||
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_BORDER_SIZE, sizes, 4);
|
||||
}
|
||||
|
||||
void
|
||||
e_hints_window_size_unset(E_Border *bd)
|
||||
{
|
||||
ecore_x_window_prop_property_del(bd->client.win, E_ATOM_BORDER_SIZE);
|
||||
}
|
||||
|
||||
int
|
||||
e_hints_window_saved_size_get(E_Border *bd)
|
||||
e_hints_window_size_get(E_Border *bd)
|
||||
{
|
||||
int ret;
|
||||
unsigned int sizes[4];
|
||||
|
||||
memset(sizes, 0, sizeof(sizes));
|
||||
ret = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_SAVED_SIZE,
|
||||
ret = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_BORDER_SIZE,
|
||||
sizes, 4);
|
||||
bd->saved.x = sizes[0];
|
||||
bd->saved.y = sizes[1];
|
||||
bd->saved.w = sizes[2];
|
||||
bd->saved.h = sizes[3];
|
||||
if (ret != 4)
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
bd->x = sizes[0];
|
||||
bd->y = sizes[1];
|
||||
bd->w = sizes[2];
|
||||
bd->h = sizes[3];
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -30,8 +30,9 @@ 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);
|
||||
EAPI int e_hints_window_saved_size_get(E_Border *bd);
|
||||
EAPI void e_hints_window_size_set(E_Border *bd);
|
||||
EAPI void e_hints_window_size_unset(E_Border *bd);
|
||||
EAPI int e_hints_window_size_get(E_Border *bd);
|
||||
|
||||
EAPI void e_hints_window_shaded_set(E_Border *bd, int on);
|
||||
EAPI void e_hints_window_maximized_set(E_Border *bd, int on);
|
||||
|
|
Loading…
Reference in New Issue