[Xfce4-commits] r25863 - in xfwm4/branches/xfce_4_4: . src
Olivier Fourdan
olivier at xfce.org
Tue Jun 26 23:10:27 CEST 2007
Author: olivier
Date: 2007-06-26 21:10:27 +0000 (Tue, 26 Jun 2007)
New Revision: 25863
Modified:
xfwm4/branches/xfce_4_4/NEWS
xfwm4/branches/xfce_4_4/src/client.c
xfwm4/branches/xfce_4_4/src/netwm.c
Log:
Be more relax with transients, allow transients to be sticky independently of their parent window (Bug #3296)
Modified: xfwm4/branches/xfce_4_4/NEWS
===================================================================
--- xfwm4/branches/xfce_4_4/NEWS 2007-06-26 21:07:43 UTC (rev 25862)
+++ xfwm4/branches/xfce_4_4/NEWS 2007-06-26 21:10:27 UTC (rev 25863)
@@ -1,6 +1,8 @@
4.4.2
=====
+- Be more relax with transients, allow transients to be sticky independently
+ of their parent window (Bug #3296)
- Fix xfwm4 hanging with gtk+-2.11.x (Bug #3346)
- Plug a leak in mouse button grab when changing theme
- Fix dialogs and modals without parents not being automatically
Modified: xfwm4/branches/xfce_4_4/src/client.c
===================================================================
--- xfwm4/branches/xfce_4_4/src/client.c 2007-06-26 21:07:43 UTC (rev 25862)
+++ xfwm4/branches/xfce_4_4/src/client.c 2007-06-26 21:10:27 UTC (rev 25863)
@@ -2376,7 +2376,7 @@
}
static void
-clientShowSingle (Client * c, gboolean change_state)
+clientShowSingle (Client * c, gboolean deiconify)
{
ScreenInfo *screen_info;
DisplayInfo *display_info;
@@ -2398,7 +2398,7 @@
/* Adjust to urgency state as the window is visible */
clientUpdateUrgency (c);
}
- if (change_state)
+ if (deiconify)
{
FLAG_UNSET (c->flags, CLIENT_FLAG_ICONIFIED);
setWMState (display_info, c->window, NormalState);
@@ -2407,16 +2407,14 @@
}
void
-clientShow (Client * c, gboolean change_state)
+clientShow (Client * c, gboolean deiconify)
{
Client *c2;
GList *list_of_windows;
GList *index;
g_return_if_fail (c != NULL);
- TRACE ("entering clientShow \"%s\" (0x%lx) [with %s]",
- c->name, c->window,
- change_state ? "state change" : "no state change");
+ TRACE ("entering clientShow \"%s\" (0x%lx)", c->name, c->window);
list_of_windows = clientListTransientOrModal (c);
for (index = g_list_last (list_of_windows); index; index = g_list_previous (index))
@@ -2428,7 +2426,7 @@
{
continue;
}
- clientShowSingle (c2, change_state);
+ clientShowSingle (c2, deiconify);
}
g_list_free (list_of_windows);
@@ -2437,7 +2435,7 @@
}
static void
-clientHideSingle (Client * c, gboolean change_state)
+clientHideSingle (Client * c, gboolean iconify)
{
ScreenInfo *screen_info;
DisplayInfo *display_info;
@@ -2458,7 +2456,7 @@
}
XUnmapWindow (display_info->dpy, c->window);
XUnmapWindow (display_info->dpy, c->frame);
- if (change_state)
+ if (iconify)
{
FLAG_SET (c->flags, CLIENT_FLAG_ICONIFIED);
setWMState (display_info, c->window, IconicState);
@@ -2467,14 +2465,14 @@
}
void
-clientHide (Client * c, int ws, gboolean change_state)
+clientHide (Client * c, int ws, gboolean iconify)
{
Client *c2;
GList *list_of_windows;
GList *index;
g_return_if_fail (c != NULL);
- TRACE ("entering clientHide");
+ TRACE ("entering clientHide \"%s\" (0x%lx)", c->name, c->window);
list_of_windows = clientListTransientOrModal (c);
for (index = list_of_windows; index; index = g_list_next (index))
@@ -2500,7 +2498,12 @@
*/
continue;
}
- clientHideSingle (c2, change_state);
+
+ if (FLAG_TEST (c2->flags, CLIENT_FLAG_STICKY) && !iconify)
+ {
+ continue;
+ }
+ clientHideSingle (c2, iconify);
}
g_list_free (list_of_windows);
Modified: xfwm4/branches/xfce_4_4/src/netwm.c
===================================================================
--- xfwm4/branches/xfce_4_4/src/netwm.c 2007-06-26 21:07:43 UTC (rev 25862)
+++ xfwm4/branches/xfce_4_4/src/netwm.c 2007-06-26 21:10:27 UTC (rev 25863)
@@ -844,53 +844,56 @@
display_info = screen_info->display_info;
val = 0;
- /* This is to make sure that transient are shown with their "ancestor" window */
- c2 = clientGetTransient (c);
- if (c2)
+ if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_SESSION_MANAGED)
+ && !FLAG_TEST (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET))
{
FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
- c->win_workspace = c2->win_workspace;
- if (FLAG_TEST (c2->flags, CLIENT_FLAG_STICKY))
+ c->win_workspace = c->screen_info->current_ws;
+ }
+ if (getHint (display_info, c->window, NET_WM_DESKTOP, &val))
+ {
+ TRACE ("atom net_wm_desktop detected");
+ if (val == (int) ALL_WORKSPACES)
{
- FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
- c->win_state |= WIN_STATE_STICKY;
+ if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_STICK) && !FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
+ {
+ TRACE ("atom net_wm_desktop specifies window \"%s\" is sticky", c->name);
+ FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
+ c->win_state |= WIN_STATE_STICKY;
+ }
+ c->win_workspace = c->screen_info->current_ws;
}
+ else
+ {
+ TRACE ("atom net_wm_desktop specifies window \"%s\" is on desk %i", c->name, (int) val);
+ c->win_workspace = (int) val;
+ }
+ FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
}
- else
+ else if (getHint (display_info, c->window, WIN_WORKSPACE, &val))
{
- if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_SESSION_MANAGED)
- && !FLAG_TEST (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET))
+ TRACE ("atom win_workspace specifies window \"%s\" is on desk %i", c->name, (int) val);
+ c->win_workspace = (int) val;
+ FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
+ }
+
+ /* This is to make sure that transient are shown with their "ancestor" window */
+ if (!FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
+ {
+ c2 = clientGetTransient (c);
+ if (c2)
{
FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
- c->win_workspace = c->screen_info->current_ws;
- }
- if (getHint (display_info, c->window, NET_WM_DESKTOP, &val))
- {
- TRACE ("atom net_wm_desktop detected");
- if (val == (int) ALL_WORKSPACES)
+ c->win_workspace = c2->win_workspace;
+ if (FLAG_TEST (c2->flags, CLIENT_FLAG_STICKY))
{
- if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_STICK) && !FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
- {
- TRACE ("atom net_wm_desktop specifies window \"%s\" is sticky", c->name);
- FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
- c->win_state |= WIN_STATE_STICKY;
- }
+ FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
+ c->win_state |= WIN_STATE_STICKY;
c->win_workspace = c->screen_info->current_ws;
}
- else
- {
- TRACE ("atom net_wm_desktop specifies window \"%s\" is on desk %i", c->name, (int) val);
- c->win_workspace = (int) val;
- }
- FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
}
- else if (getHint (display_info, c->window, WIN_WORKSPACE, &val))
- {
- TRACE ("atom win_workspace specifies window \"%s\" is on desk %i", c->name, (int) val);
- c->win_workspace = (int) val;
- FLAG_SET (c->xfwm_flags, XFWM_FLAG_WORKSPACE_SET);
- }
}
+
TRACE ("initial desktop for window \"%s\" is %i", c->name, c->win_workspace);
if (c->win_workspace > c->screen_info->workspace_count - 1)
{
@@ -1259,8 +1262,7 @@
c->initial_layer = c2->win_layer;
TRACE ("Applied layer is %i", c->initial_layer);
}
- FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_HAS_HIDE | XFWM_FLAG_HAS_STICK);
- FLAG_UNSET (c->flags, CLIENT_FLAG_STICKY);
+ FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_HAS_HIDE);
}
if ((old_type != c->type) || (c->initial_layer != c->win_layer))
{
More information about the Xfce4-commits
mailing list