get client leader prop - special spot for placement if special window.

SVN revision: 15381
This commit is contained in:
Carsten Haitzler 2005-06-17 09:05:38 +00:00
parent e5e4ea1459
commit 75a39d0d93
3 changed files with 58 additions and 20 deletions

1
TODO
View File

@ -65,7 +65,6 @@ These are in no particular order:
them back by saying "get me that lost window" them back by saying "get me that lost window"
* netwm window types and states need addressing (do special/appropriate things) * netwm window types and states need addressing (do special/appropriate things)
for each of them. for each of them.
* set _NET_WM_ALLOWED_ACTIONS
* use ecore_x_netwm_ping_send() to windowsthat suport it regularly to see if * use ecore_x_netwm_ping_send() to windowsthat suport it regularly to see if
they are dead or not (do this all the time - like every few seconds) to be they are dead or not (do this all the time - like every few seconds) to be
able to inform users of dead applications about the time they die, not some able to inform users of dead applications about the time they die, not some

View File

@ -347,6 +347,8 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
bd->client.mwm.fetch.hints = 1; bd->client.mwm.fetch.hints = 1;
else if (atoms[i] == ECORE_X_ATOM_WM_TRANSIENT_FOR) else if (atoms[i] == ECORE_X_ATOM_WM_TRANSIENT_FOR)
bd->client.icccm.fetch.transient_for = 1; bd->client.icccm.fetch.transient_for = 1;
else if (atoms[i] == ECORE_X_ATOM_WM_CLIENT_LEADER)
bd->client.icccm.fetch.client_leader = 1;
else if (atoms[i] == ECORE_X_ATOM_WM_WINDOW_ROLE) else if (atoms[i] == ECORE_X_ATOM_WM_WINDOW_ROLE)
bd->client.icccm.fetch.window_role = 1; bd->client.icccm.fetch.window_role = 1;
else if (atoms[i] == ECORE_X_ATOM_WM_STATE) else if (atoms[i] == ECORE_X_ATOM_WM_STATE)
@ -2099,6 +2101,11 @@ _e_border_cb_window_property(void *data, int ev_type, void *ev)
bd->client.icccm.fetch.transient_for = 1; bd->client.icccm.fetch.transient_for = 1;
bd->changed = 1; bd->changed = 1;
} }
else if (e->atom == ECORE_X_ATOM_WM_CLIENT_LEADER)
{
bd->client.icccm.fetch.client_leader = 1;
bd->changed = 1;
}
else if (e->atom == ECORE_X_ATOM_WM_WINDOW_ROLE) else if (e->atom == ECORE_X_ATOM_WM_WINDOW_ROLE)
{ {
bd->client.icccm.fetch.window_role = 1; bd->client.icccm.fetch.window_role = 1;
@ -3458,6 +3465,11 @@ _e_border_eval(E_Border *bd)
bd->client.icccm.transient_for = ecore_x_icccm_transient_for_get(bd->client.win); bd->client.icccm.transient_for = ecore_x_icccm_transient_for_get(bd->client.win);
bd->client.icccm.fetch.transient_for = 0; bd->client.icccm.fetch.transient_for = 0;
} }
if (bd->client.icccm.fetch.client_leader)
{
bd->client.icccm.client_leader = ecore_x_icccm_client_leader_get(bd->client.win);
bd->client.icccm.fetch.client_leader = 0;
}
if (bd->client.icccm.fetch.window_role) if (bd->client.icccm.fetch.window_role)
{ {
bd->client.icccm.window_role = ecore_x_icccm_window_role_get(bd->client.win); bd->client.icccm.window_role = ecore_x_icccm_window_role_get(bd->client.win);
@ -3468,6 +3480,7 @@ _e_border_eval(E_Border *bd)
e_hints_window_state_set(bd); e_hints_window_state_set(bd);
bd->client.netwm.update.state = 0; bd->client.netwm.update.state = 0;
} }
if (bd->changes.icon) if (bd->changes.icon)
{ {
if (bd->icon_object) if (bd->icon_object)
@ -3746,6 +3759,29 @@ _e_border_eval(E_Border *bd)
bd->changes.pos = 1; bd->changes.pos = 1;
} }
else else
{
int placed = 0;
/* FIXME: special placement for dialogs etc. etc. etc goes
* here */
if ((bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG) &&
((bd->client.icccm.transient_for != 0)))
{
E_Border *bd_parent;
bd_parent = e_border_find_by_client_window(bd->client.icccm.transient_for);
// if (!bd_parent)
// bd_parent = e_border_find_by_client_window(bd->client.icccm.client_leader);
/* FIXME: what if parent is not on this desktop - or zone? */
if ((bd_parent) && (bd_parent->visible))
{
bd->x = bd_parent->x + ((bd_parent->w - bd->w) / 2);
bd->y = bd_parent->y + ((bd_parent->h - bd->h) / 2);
bd->changes.pos = 1;
placed = 1;
}
}
if (!placed)
{ {
Evas_List *skiplist = NULL; Evas_List *skiplist = NULL;
int new_x, new_y; int new_x, new_y;
@ -3770,6 +3806,7 @@ _e_border_eval(E_Border *bd)
bd->changes.pos = 1; bd->changes.pos = 1;
} }
} }
}
while (bd->pending_move_resize) while (bd->pending_move_resize)
{ {
E_Border_Pending_Move_Resize *pnd; E_Border_Pending_Move_Resize *pnd;

View File

@ -128,6 +128,7 @@ struct _E_Border
Ecore_X_Window icon_window; Ecore_X_Window icon_window;
Ecore_X_Window window_group; Ecore_X_Window window_group;
Ecore_X_Window transient_for; Ecore_X_Window transient_for;
Ecore_X_Window client_leader;
Ecore_X_Gravity gravity; Ecore_X_Gravity gravity;
char *window_role; char *window_role;
unsigned char take_focus : 1; unsigned char take_focus : 1;
@ -144,6 +145,7 @@ struct _E_Border
unsigned char size_pos_hints : 1; unsigned char size_pos_hints : 1;
unsigned char protocol : 1; unsigned char protocol : 1;
unsigned char transient_for : 1; unsigned char transient_for : 1;
unsigned char client_leader : 1;
unsigned char window_role : 1; unsigned char window_role : 1;
unsigned char state : 1; unsigned char state : 1;
} fetch; } fetch;