summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOlivier Fourdan <fourdan.olivier@wanadoo.fr>2004-05-30 23:18:17 +0000
committerOlivier Fourdan <fourdan.olivier@wanadoo.fr>2004-05-30 23:18:17 +0000
commit012d847e378440899ed9eae4061fa696ccb6ba09 (patch)
treefd919e7b379714cb9effc3aea1beee3a9ca33b18 /src
parent00e75680017e2846da115d1f888fd87a6496c8d8 (diff)
downloadxfwm4-012d847e378440899ed9eae4061fa696ccb6ba09.tar.gz
- Change gtktoxevent API to be GdkScreen and therefore multiscreen compliant
- Modify xfwm4 to be compatible with the gtktoxevent API change (make sure you update both libxfcegui4 *and* xfwm4 at the same time!) - Code cleanup in xfwm4; move global variables in a dynamically allocated structure. (Old svn revision: 11770)
Diffstat (limited to 'src')
-rw-r--r--src/client.c494
-rw-r--r--src/client.h46
-rw-r--r--src/events.c154
-rw-r--r--src/events.h26
-rw-r--r--src/focus.c422
-rw-r--r--src/focus.h36
-rw-r--r--src/frame.c1350
-rw-r--r--src/frame.h26
-rw-r--r--src/hints.c21
-rw-r--r--src/hints.h33
-rw-r--r--src/keyboard.c424
-rw-r--r--src/keyboard.h26
-rw-r--r--src/main.c216
-rw-r--r--src/main.h45
-rw-r--r--src/menu.c373
-rw-r--r--src/menu.h32
-rw-r--r--src/misc.c52
-rw-r--r--src/misc.h26
-rw-r--r--src/mypixmap.c86
-rw-r--r--src/mypixmap.h28
-rw-r--r--src/mywindow.c83
-rw-r--r--src/mywindow.h26
-rw-r--r--src/netwm.c48
-rw-r--r--src/netwm.h46
-rw-r--r--src/parserc.c268
-rw-r--r--src/parserc.h26
-rw-r--r--src/placement.c174
-rw-r--r--src/placement.h30
-rw-r--r--src/poswin.c30
-rw-r--r--src/poswin.h26
-rw-r--r--src/session.c756
-rw-r--r--src/session.h2
-rw-r--r--src/settings.c1803
-rw-r--r--src/settings.h30
-rw-r--r--src/spinning_cursor.c35
-rw-r--r--src/spinning_cursor.h26
-rw-r--r--src/stacking.c546
-rw-r--r--src/stacking.h24
-rw-r--r--src/startup_notification.c200
-rw-r--r--src/startup_notification.h26
-rw-r--r--src/tabwin.c36
-rw-r--r--src/tabwin.h24
-rw-r--r--src/transients.c200
-rw-r--r--src/transients.h24
-rw-r--r--src/workspaces.c242
-rw-r--r--src/workspaces.h26
46 files changed, 4344 insertions, 4329 deletions
diff --git a/src/client.c b/src/client.c
index 3b9941e28..32203febc 100644
--- a/src/client.c
+++ b/src/client.c
@@ -180,8 +180,8 @@ clientInstallColormaps (Client * c)
{
for (i = c->ncmap - 1; i >= 0; i--)
{
- XGetWindowAttributes (dpy, c->cmap_windows[i], &attr);
- XInstallColormap (dpy, attr.colormap);
+ XGetWindowAttributes (md->dpy, c->cmap_windows[i], &attr);
+ XInstallColormap (md->dpy, attr.colormap);
if (c->cmap_windows[i] == c->window)
{
installed = TRUE;
@@ -190,7 +190,7 @@ clientInstallColormaps (Client * c)
}
if ((!installed) && (c->cmap))
{
- XInstallColormap (dpy, c->cmap);
+ XInstallColormap (md->dpy, c->cmap);
}
}
@@ -206,7 +206,7 @@ clientUpdateColormaps (Client * c)
{
XFree (c->cmap_windows);
}
- if (!XGetWMColormapWindows (dpy, c->window, &c->cmap_windows, &c->ncmap))
+ if (!XGetWMColormapWindows (md->dpy, c->window, &c->cmap_windows, &c->ncmap))
{
c->ncmap = 0;
}
@@ -221,7 +221,7 @@ clientUpdateAllFrames (int mask)
XWindowChanges wc;
TRACE ("entering clientRedrawAllFrames");
- XGrabPointer (dpy, gnome_win, FALSE, EnterWindowMask, GrabModeAsync,
+ XGrabPointer (md->dpy, md->gnome_win, FALSE, EnterWindowMask, GrabModeAsync,
GrabModeAsync, None, None, GDK_CURRENT_TIME);
for (c = clients, i = 0; i < client_count; c = c->next, i++)
{
@@ -249,7 +249,7 @@ clientUpdateAllFrames (int mask)
frameDraw (c, FALSE, FALSE);
}
}
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
}
void
@@ -259,58 +259,58 @@ clientGrabKeys (Client * c)
TRACE ("entering clientGrabKeys");
TRACE ("grabbing keys for client \"%s\" (0x%lx)", c->name, c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_UP], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_DOWN], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_LEFT], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_RIGHT], c->window);
- grabKey (dpy, &params.keys[KEY_RESIZE_UP], c->window);
- grabKey (dpy, &params.keys[KEY_RESIZE_DOWN], c->window);
- grabKey (dpy, &params.keys[KEY_RESIZE_LEFT], c->window);
- grabKey (dpy, &params.keys[KEY_RESIZE_RIGHT], c->window);
- grabKey (dpy, &params.keys[KEY_CLOSE_WINDOW], c->window);
- grabKey (dpy, &params.keys[KEY_HIDE_WINDOW], c->window);
- grabKey (dpy, &params.keys[KEY_MAXIMIZE_WINDOW], c->window);
- grabKey (dpy, &params.keys[KEY_MAXIMIZE_VERT], c->window);
- grabKey (dpy, &params.keys[KEY_MAXIMIZE_HORIZ], c->window);
- grabKey (dpy, &params.keys[KEY_SHADE_WINDOW], c->window);
- grabKey (dpy, &params.keys[KEY_STICK_WINDOW], c->window);
- grabKey (dpy, &params.keys[KEY_RAISE_WINDOW], c->window);
- grabKey (dpy, &params.keys[KEY_LOWER_WINDOW], c->window);
- grabKey (dpy, &params.keys[KEY_CYCLE_WINDOWS], c->window);
- grabKey (dpy, &params.keys[KEY_NEXT_WORKSPACE], c->window);
- grabKey (dpy, &params.keys[KEY_PREV_WORKSPACE], c->window);
- grabKey (dpy, &params.keys[KEY_ADD_WORKSPACE], c->window);
- grabKey (dpy, &params.keys[KEY_DEL_WORKSPACE], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_1], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_2], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_3], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_4], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_5], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_6], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_7], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_8], c->window);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_9], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_NEXT_WORKSPACE], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_PREV_WORKSPACE], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_1], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_2], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_3], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_4], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_5], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_6], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_7], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_8], c->window);
- grabKey (dpy, &params.keys[KEY_MOVE_WORKSPACE_9], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_1], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_2], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_3], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_4], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_5], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_6], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_7], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_8], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_9], c->window);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_10], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_UP], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_DOWN], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_LEFT], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_RIGHT], c->window);
+ grabKey (md->dpy, &params.keys[KEY_RESIZE_UP], c->window);
+ grabKey (md->dpy, &params.keys[KEY_RESIZE_DOWN], c->window);
+ grabKey (md->dpy, &params.keys[KEY_RESIZE_LEFT], c->window);
+ grabKey (md->dpy, &params.keys[KEY_RESIZE_RIGHT], c->window);
+ grabKey (md->dpy, &params.keys[KEY_CLOSE_WINDOW], c->window);
+ grabKey (md->dpy, &params.keys[KEY_HIDE_WINDOW], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MAXIMIZE_WINDOW], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MAXIMIZE_VERT], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MAXIMIZE_HORIZ], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHADE_WINDOW], c->window);
+ grabKey (md->dpy, &params.keys[KEY_STICK_WINDOW], c->window);
+ grabKey (md->dpy, &params.keys[KEY_RAISE_WINDOW], c->window);
+ grabKey (md->dpy, &params.keys[KEY_LOWER_WINDOW], c->window);
+ grabKey (md->dpy, &params.keys[KEY_CYCLE_WINDOWS], c->window);
+ grabKey (md->dpy, &params.keys[KEY_NEXT_WORKSPACE], c->window);
+ grabKey (md->dpy, &params.keys[KEY_PREV_WORKSPACE], c->window);
+ grabKey (md->dpy, &params.keys[KEY_ADD_WORKSPACE], c->window);
+ grabKey (md->dpy, &params.keys[KEY_DEL_WORKSPACE], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_1], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_2], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_3], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_4], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_5], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_6], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_7], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_8], c->window);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_9], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_NEXT_WORKSPACE], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_PREV_WORKSPACE], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_1], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_2], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_3], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_4], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_5], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_6], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_7], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_8], c->window);
+ grabKey (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_9], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_1], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_2], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_3], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_4], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_5], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_6], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_7], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_8], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_9], c->window);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_10], c->window);
}
void
@@ -320,7 +320,7 @@ clientUngrabKeys (Client * c)
TRACE ("entering clientUngrabKeys");
TRACE ("ungrabing keys for client \"%s\" (0x%lx)", c->name, c->window);
- ungrabKeys (dpy, c->window);
+ ungrabKeys (md->dpy, c->window);
}
void
@@ -330,9 +330,9 @@ clientGrabButtons (Client * c)
TRACE ("entering clientGrabButtons");
TRACE ("grabbing buttons for client \"%s\" (0x%lx)", c->name, c->window);
- grabButton(dpy, Button1, AltMask, c->window);
- grabButton(dpy, Button2, AltMask, c->window);
- grabButton(dpy, Button3, AltMask, c->window);
+ grabButton(md->dpy, Button1, AltMask, c->window);
+ grabButton(md->dpy, Button2, AltMask, c->window);
+ grabButton(md->dpy, Button3, AltMask, c->window);
}
void
@@ -342,7 +342,7 @@ clientUngrabButtons (Client * c)
TRACE ("entering clientUngrabButtons");
TRACE ("grabbing buttons for client \"%s\" (0x%lx)", c->name, c->window);
- XUngrabButton (dpy, AnyButton, AnyModifier, c->window);
+ XUngrabButton (md->dpy, AnyButton, AnyModifier, c->window);
}
void
@@ -669,9 +669,9 @@ clientConfigure (Client * c, XWindowChanges * wc, int mask, unsigned short flags
clientConstrainPos (c, TRUE);
}
- XMoveResizeWindow (dpy, c->frame, frameX (c), frameY (c),
+ XMoveResizeWindow (md->dpy, c->frame, frameX (c), frameY (c),
frameWidth (c), frameHeight (c));
- XMoveResizeWindow (dpy, c->window, frameLeft (c), frameTop (c),
+ XMoveResizeWindow (md->dpy, c->window, frameLeft (c), frameTop (c),
c->width, c->height);
if (resized || (flags & CFG_FORCE_REDRAW))
@@ -685,7 +685,7 @@ clientConfigure (Client * c, XWindowChanges * wc, int mask, unsigned short flags
{
DBG ("Sending ConfigureNotify");
ce.type = ConfigureNotify;
- ce.display = dpy;
+ ce.display = md->dpy;
ce.event = c->window;
ce.window = c->window;
ce.x = c->x;
@@ -695,7 +695,7 @@ clientConfigure (Client * c, XWindowChanges * wc, int mask, unsigned short flags
ce.border_width = 0;
ce.above = c->frame;
ce.override_redirect = FALSE;
- XSendEvent (dpy, c->window, FALSE, StructureNotifyMask,
+ XSendEvent (md->dpy, c->window, FALSE, StructureNotifyMask,
(XEvent *) & ce);
}
}
@@ -712,7 +712,7 @@ clientGetMWMHints (Client * c, gboolean update)
TRACE ("entering clientGetMWMHints client \"%s\" (0x%lx)", c->name,
c->window);
- mwm_hints = getMotifHints (dpy, c->window);
+ mwm_hints = getMotifHints (md->dpy, c->window);
if (mwm_hints)
{
if (mwm_hints->flags & MWM_HINTS_DECORATIONS)
@@ -821,7 +821,7 @@ clientGetWMNormalHints (Client * c, gboolean update)
c->size = XAllocSizeHints ();
}
g_assert (c->size);
- if (!XGetWMNormalHints (dpy, c->window, c->size, &dummy))
+ if (!XGetWMNormalHints (md->dpy, c->window, c->size, &dummy))
{
c->size->flags = 0;
}
@@ -967,7 +967,7 @@ clientGetWMProtocols (Client * c)
TRACE ("entering clientGetWMProtocols client \"%s\" (0x%lx)", c->name,
c->window);
- wm_protocols_flags = getWMProtocols (dpy, c->window);
+ wm_protocols_flags = getWMProtocols (md->dpy, c->window);
FLAG_SET (c->wm_flags,
(wm_protocols_flags & WM_PROTOCOLS_DELETE_WINDOW) ?
WM_FLAG_DELETE : 0);
@@ -1195,9 +1195,9 @@ clientCheckShape (Client * c)
int boundingShaped, clipShaped;
g_return_val_if_fail (c != NULL, FALSE);
- if (shape)
+ if (md->shape)
{
- XShapeQueryExtents (dpy, c->window, &boundingShaped, &xws, &yws, &wws,
+ XShapeQueryExtents (md->dpy, c->window, &boundingShaped, &xws, &yws, &wws,
&hws, &clipShaped, &xbs, &ybs, &wbs, &hbs);
return (boundingShaped != 0);
}
@@ -1209,14 +1209,14 @@ clientClearPixmapCache (Client * c)
{
g_return_if_fail (c != NULL);
- myPixmapFree (dpy, &c->pm_cache.pm_title[ACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_title[INACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_sides[SIDE_LEFT][ACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_sides[SIDE_LEFT][INACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_sides[SIDE_RIGHT][ACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_sides[SIDE_RIGHT][INACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_sides[SIDE_BOTTOM][ACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_sides[SIDE_BOTTOM][INACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_title[ACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_title[INACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_sides[SIDE_LEFT][ACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_sides[SIDE_LEFT][INACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_sides[SIDE_RIGHT][ACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_sides[SIDE_RIGHT][INACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_sides[SIDE_BOTTOM][ACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_sides[SIDE_BOTTOM][INACTIVE]);
}
void
@@ -1224,7 +1224,7 @@ clientGetUserTime (Client * c)
{
g_return_if_fail (c != NULL);
- if (getNetWMUserTime (dpy, c->window, &c->user_time))
+ if (getNetWMUserTime (md->dpy, c->window, &c->user_time))
{
FLAG_SET (c->flags, CLIENT_FLAG_HAS_USER_TIME);
}
@@ -1244,22 +1244,22 @@ clientFrame (Window w, gboolean recapture)
TRACE ("entering clientFrame");
TRACE ("framing client (0x%lx)", w);
- if (w == gnome_win)
+ if (w == md->gnome_win)
{
TRACE ("Not managing our own window");
return;
}
gdk_error_trap_push ();
- if (checkKdeSystrayWindow (dpy, w) && (systray != None))
+ if (checkKdeSystrayWindow (md->dpy, w) && (md->systray != None))
{
- TRACE ("Not managing KDE systray windows");
- sendSystrayReqDock (dpy, w, systray);
+ TRACE ("Not managing KDE md->systray windows");
+ sendSystrayReqDock (md->dpy, w, md->systray);
gdk_error_trap_pop ();
return;
}
- if (!XGetWindowAttributes (dpy, w, &attr))
+ if (!XGetWindowAttributes (md->dpy, w, &attr))
{
TRACE ("Cannot get window attributes");
gdk_error_trap_pop ();
@@ -1284,9 +1284,9 @@ clientFrame (Window w, gboolean recapture)
c->window = w;
c->serial = client_serial++;
- getWindowName (dpy, c->window, &c->name);
+ getWindowName (md->dpy, c->window, &c->name);
TRACE ("name \"%s\"", c->name);
- getTransientFor (dpy, screen, c->window, &c->transient_for);
+ getTransientFor (md->dpy, md->screen, c->window, &c->transient_for);
/* Initialize structure */
c->size = NULL;
@@ -1332,15 +1332,15 @@ clientFrame (Window w, gboolean recapture)
c->button_pressed[i] = FALSE;
}
- if (!XGetWMColormapWindows (dpy, c->window, &c->cmap_windows, &c->ncmap))
+ if (!XGetWMColormapWindows (md->dpy, c->window, &c->cmap_windows, &c->ncmap))
{
c->ncmap = 0;
}
c->class.res_name = NULL;
c->class.res_class = NULL;
- XGetClassHint (dpy, w, &c->class);
- c->wmhints = XGetWMHints (dpy, c->window);
+ XGetClassHint (md->dpy, w, &c->class);
+ c->wmhints = XGetWMHints (md->dpy, c->window);
c->group_leader = None;
if (c->wmhints)
{
@@ -1349,10 +1349,10 @@ clientFrame (Window w, gboolean recapture)
c->group_leader = c->wmhints->window_group;
}
}
- c->client_leader = getClientLeader (dpy, c->window);
+ c->client_leader = getClientLeader (md->dpy, c->window);
#ifdef HAVE_LIBSTARTUP_NOTIFICATION
c->startup_id = NULL;
- getWindowStartupId (dpy, c->window, &c->startup_id);
+ getWindowStartupId (md->dpy, c->window, &c->startup_id);
#endif /* HAVE_LIBSTARTUP_NOTIFICATION */
TRACE ("\"%s\" (0x%lx) initial map_state = %s",
c->name, c->window,
@@ -1370,7 +1370,7 @@ clientFrame (Window w, gboolean recapture)
* Unset the "mapped" flag to avoid a transition to
* withdrawn state.
*/
- XUnmapWindow (dpy, c->window);
+ XUnmapWindow (md->dpy, c->window);
FLAG_SET (c->flags, CLIENT_FLAG_MAP_PENDING);
}
@@ -1383,14 +1383,14 @@ clientFrame (Window w, gboolean recapture)
clientGetWMProtocols (c);
clientGetMWMHints (c, FALSE);
- getHint (dpy, w, win_hints, &c->win_hints);
- getHint (dpy, w, win_state, &c->win_state);
- if (!getHint (dpy, w, win_layer, &c->win_layer))
+ getHint (md->dpy, w, win_hints, &c->win_hints);
+ getHint (md->dpy, w, win_state, &c->win_state);
+ if (!getHint (md->dpy, w, win_layer, &c->win_layer))
{
c->win_layer = WIN_LAYER_NORMAL;
}
- /* Reload from session */
+ /* md->reload from session */
if (sessionMatchWinToSM (c))
{
FLAG_SET (c->flags, CLIENT_FLAG_SESSION_MANAGED);
@@ -1407,8 +1407,8 @@ clientFrame (Window w, gboolean recapture)
c->legacy_fullscreen = FALSE;
/* Fullscreen for older legacy apps */
if ((c->x == 0) && (c->y == 0) &&
- (c->width == gdk_screen_get_width (gscr)) &&
- (c->height == gdk_screen_get_height (gscr)) &&
+ (c->width == gdk_screen_get_width (md->gscr)) &&
+ (c->height == gdk_screen_get_height (md->gscr)) &&
!FLAG_TEST(c->flags, CLIENT_FLAG_HAS_BORDER) &&
(c->win_layer == WIN_LAYER_NORMAL) &&
(c->type == WINDOW_NORMAL))
@@ -1454,18 +1454,18 @@ clientFrame (Window w, gboolean recapture)
valuemask = CWEventMask;
attributes.event_mask = (FRAME_EVENT_MASK | POINTER_EVENT_MASK);
c->frame =
- XCreateWindow (dpy, root, frameX (c), frameY (c), frameWidth (c),
+ XCreateWindow (md->dpy, md->xroot, frameX (c), frameY (c), frameWidth (c),
frameHeight (c), 0, CopyFromParent, InputOutput, CopyFromParent,
valuemask, &attributes);
- XSetWindowBorderWidth (dpy, c->window, 0);
- XReparentWindow (dpy, c->window, c->frame, frameLeft (c), frameTop (c));
+ XSetWindowBorderWidth (md->dpy, c->window, 0);
+ XReparentWindow (md->dpy, c->window, c->frame, frameLeft (c), frameTop (c));
valuemask = CWEventMask;
attributes.event_mask = (CLIENT_EVENT_MASK);
- XChangeWindowAttributes (dpy, c->window, valuemask, &attributes);
- if (shape)
+ XChangeWindowAttributes (md->dpy, c->window, valuemask, &attributes);
+ if (md->shape)
{
- XShapeSelectInput (dpy, c->window, ShapeNotifyMask);
+ XShapeSelectInput (md->dpy, c->window, ShapeNotifyMask);
}
if (!recapture)
{
@@ -1492,24 +1492,24 @@ clientFrame (Window w, gboolean recapture)
c->pm_cache.previous_width = -1;
c->pm_cache.previous_height = -1;
- myWindowCreate (dpy, c->frame, &c->sides[SIDE_LEFT],
- resize_cursor[4 + SIDE_LEFT]);
- myWindowCreate (dpy, c->frame, &c->sides[SIDE_RIGHT],
- resize_cursor[4 + SIDE_RIGHT]);
- myWindowCreate (dpy, c->frame, &c->sides[SIDE_BOTTOM],
- resize_cursor[4 + SIDE_BOTTOM]);
- myWindowCreate (dpy, c->frame, &c->corners[CORNER_BOTTOM_LEFT],
- resize_cursor[CORNER_BOTTOM_LEFT]);
- myWindowCreate (dpy, c->frame, &c->corners[CORNER_BOTTOM_RIGHT],
- resize_cursor[CORNER_BOTTOM_RIGHT]);
- myWindowCreate (dpy, c->frame, &c->corners[CORNER_TOP_LEFT],
- resize_cursor[CORNER_TOP_LEFT]);
- myWindowCreate (dpy, c->frame, &c->corners[CORNER_TOP_RIGHT],
- resize_cursor[CORNER_TOP_RIGHT]);
- myWindowCreate (dpy, c->frame, &c->title, None);
+ myWindowCreate (md->dpy, c->frame, &c->sides[SIDE_LEFT],
+ md->resize_cursor[4 + SIDE_LEFT]);
+ myWindowCreate (md->dpy, c->frame, &c->sides[SIDE_RIGHT],
+ md->resize_cursor[4 + SIDE_RIGHT]);
+ myWindowCreate (md->dpy, c->frame, &c->sides[SIDE_BOTTOM],
+ md->resize_cursor[4 + SIDE_BOTTOM]);
+ myWindowCreate (md->dpy, c->frame, &c->corners[CORNER_BOTTOM_LEFT],
+ md->resize_cursor[CORNER_BOTTOM_LEFT]);
+ myWindowCreate (md->dpy, c->frame, &c->corners[CORNER_BOTTOM_RIGHT],
+ md->resize_cursor[CORNER_BOTTOM_RIGHT]);
+ myWindowCreate (md->dpy, c->frame, &c->corners[CORNER_TOP_LEFT],
+ md->resize_cursor[CORNER_TOP_LEFT]);
+ myWindowCreate (md->dpy, c->frame, &c->corners[CORNER_TOP_RIGHT],
+ md->resize_cursor[CORNER_TOP_RIGHT]);
+ myWindowCreate (md->dpy, c->frame, &c->title, None);
for (i = 0; i < BUTTON_COUNT; i++)
{
- myWindowCreate (dpy, c->frame, &c->buttons[i], None);
+ myWindowCreate (md->dpy, c->frame, &c->buttons[i], None);
}
TRACE ("now calling configure for the new window \"%s\" (0x%lx)", c->name,
c->window);
@@ -1530,7 +1530,7 @@ clientFrame (Window w, gboolean recapture)
c->first_map = TRUE;
if (!FLAG_TEST (c->flags, CLIENT_FLAG_HIDDEN))
{
- if ((c->win_workspace == workspace) ||
+ if ((c->win_workspace == md->current_ws) ||
FLAG_TEST(c->flags, CLIENT_FLAG_STICKY))
{
clientShow (c, TRUE);
@@ -1546,7 +1546,7 @@ clientFrame (Window w, gboolean recapture)
}
else
{
- setWMState (dpy, c->window, IconicState);
+ setWMState (md->dpy, c->window, IconicState);
clientSetNetState (c);
}
gdk_error_trap_pop ();
@@ -1585,33 +1585,33 @@ clientUnframe (Client * c, gboolean remap)
gdk_error_trap_push ();
clientUngrabKeys (c);
clientGrabButtons (c);
- XUnmapWindow (dpy, c->window);
- XUnmapWindow (dpy, c->frame);
+ XUnmapWindow (md->dpy, c->window);
+ XUnmapWindow (md->dpy, c->frame);
clientGravitate (c, REMOVE);
- XSelectInput (dpy, c->window, NoEventMask);
- reparented = XCheckTypedWindowEvent (dpy, c->window, ReparentNotify, &ev);
+ XSelectInput (md->dpy, c->window, NoEventMask);
+ reparented = XCheckTypedWindowEvent (md->dpy, c->window, ReparentNotify, &ev);
if (remap || !reparented)
{
- XReparentWindow (dpy, c->window, root, c->x, c->y);
- XSetWindowBorderWidth (dpy, c->window, c->border_width);
+ XReparentWindow (md->dpy, c->window, md->xroot, c->x, c->y);
+ XSetWindowBorderWidth (md->dpy, c->window, c->border_width);
if (remap)
{
- XMapWindow (dpy, c->window);
+ XMapWindow (md->dpy, c->window);
}
else
{
- setWMState (dpy, c->window, WithdrawnState);
+ setWMState (md->dpy, c->window, WithdrawnState);
}
}
if (!remap)
{
- XDeleteProperty (dpy, c->window, net_wm_state);
- XDeleteProperty (dpy, c->window, win_state);
- XDeleteProperty (dpy, c->window, net_wm_desktop);
- XDeleteProperty (dpy, c->window, win_workspace);
- XDeleteProperty (dpy, c->window, net_wm_allowed_actions);
+ XDeleteProperty (md->dpy, c->window, net_wm_state);
+ XDeleteProperty (md->dpy, c->window, win_state);
+ XDeleteProperty (md->dpy, c->window, net_wm_desktop);
+ XDeleteProperty (md->dpy, c->window, win_workspace);
+ XDeleteProperty (md->dpy, c->window, net_wm_allowed_actions);
}
myWindowDelete (&c->title);
@@ -1627,10 +1627,10 @@ clientUnframe (Client * c, gboolean remap)
{
myWindowDelete (&c->buttons[i]);
}
- XDestroyWindow (dpy, c->frame);
+ XDestroyWindow (md->dpy, c->frame);
if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_STRUT))
{
- workspaceUpdateArea (margins, gnome_margins);
+ workspaceUpdateArea (md->margins, md->gnome_margins);
}
myXUngrabServer ();
@@ -1654,16 +1654,16 @@ clientFrameAll ()
clientSetFocus (NULL, GDK_CURRENT_TIME, NO_FOCUS_FLAG);
shield =
setTmpEventWin (0, 0,
- gdk_screen_get_width (gscr),
- gdk_screen_get_height (gscr),
+ gdk_screen_get_width (md->gscr),
+ gdk_screen_get_height (md->gscr),
EnterWindowMask);
- XSync (dpy, FALSE);
+ XSync (md->dpy, FALSE);
myXGrabServer ();
- XQueryTree (dpy, root, &w1, &w2, &wins, &count);
+ XQueryTree (md->dpy, md->xroot, &w1, &w2, &wins, &count);
for (i = 0; i < count; i++)
{
- XGetWindowAttributes (dpy, wins[i], &attr);
+ XGetWindowAttributes (md->dpy, wins[i], &attr);
if ((!(attr.override_redirect)) && (attr.map_state == IsViewable))
{
clientFrame (wins[i], TRUE);
@@ -1676,7 +1676,7 @@ clientFrameAll ()
clientFocusTop (WIN_LAYER_NORMAL);
removeTmpEventWin (shield);
myXUngrabServer ();
- XSync (dpy, FALSE);
+ XSync (md->dpy, FALSE);
}
void
@@ -1689,9 +1689,9 @@ clientUnframeAll ()
TRACE ("entering clientUnframeAll");
clientSetFocus (NULL, GDK_CURRENT_TIME, FOCUS_IGNORE_MODAL);
- XSync (dpy, FALSE);
+ XSync (md->dpy, FALSE);
myXGrabServer ();
- XQueryTree (dpy, root, &w1, &w2, &wins, &count);
+ XQueryTree (md->dpy, md->xroot, &w1, &w2, &wins, &count);
for (i = 0; i < count; i++)
{
c = clientGetFromWindow (wins[i], FRAME);
@@ -1701,7 +1701,7 @@ clientUnframeAll ()
}
}
myXUngrabServer ();
- XSync(dpy, FALSE);
+ XSync(md->dpy, FALSE);
if (wins)
{
XFree (wins);
@@ -1766,17 +1766,17 @@ clientSetWorkspaceSingle (Client * c, int ws)
if (c->win_workspace != ws)
{
- TRACE ("setting client \"%s\" (0x%lx) to workspace %d", c->name,
+ TRACE ("setting client \"%s\" (0x%lx) to md->current_ws %d", c->name,
c->window, ws);
c->win_workspace = ws;
- setHint (dpy, c->window, win_workspace, ws);
+ setHint (md->dpy, c->window, win_workspace, ws);
if (FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
{
- setHint (dpy, c->window, net_wm_desktop, (unsigned long) ALL_WORKSPACES);
+ setHint (md->dpy, c->window, net_wm_desktop, (unsigned long) ALL_WORKSPACES);
}
else
{
- setHint (dpy, c->window, net_wm_desktop, (unsigned long) ws);
+ setHint (md->dpy, c->window, net_wm_desktop, (unsigned long) ws);
}
}
FLAG_SET (c->flags, CLIENT_FLAG_WORKSPACE_SET);
@@ -1799,7 +1799,7 @@ clientSetWorkspace (Client * c, int ws, gboolean manage_mapping)
c2 = (Client *) index->data;
if (c2->win_workspace != ws)
{
- TRACE ("setting client \"%s\" (0x%lx) to workspace %d", c->name,
+ TRACE ("setting client \"%s\" (0x%lx) to md->current_ws %d", c->name,
c->window, ws);
clientSetWorkspaceSingle (c2, ws);
if (manage_mapping && !clientIsTransientOrModal (c2)
@@ -1811,13 +1811,13 @@ clientSetWorkspace (Client * c, int ws, gboolean manage_mapping)
}
else
{
- if (ws == workspace)
+ if (ws == md->current_ws)
{
clientShow (c2, FALSE);
}
else
{
- clientHide (c2, workspace, FALSE);
+ clientHide (c2, md->current_ws, FALSE);
}
}
}
@@ -1831,19 +1831,19 @@ clientShowSingle (Client * c, gboolean change_state)
{
g_return_if_fail (c != NULL);
myXGrabServer ();
- if ((c->win_workspace == workspace)
+ if ((c->win_workspace == md->current_ws)
|| FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
{
TRACE ("showing client \"%s\" (0x%lx)", c->name, c->window);
FLAG_SET (c->flags, CLIENT_FLAG_VISIBLE);
- XMapWindow (dpy, c->frame);
- XMapWindow (dpy, c->window);
+ XMapWindow (md->dpy, c->frame);
+ XMapWindow (md->dpy, c->window);
}
if (change_state)
{
FLAG_UNSET (c->flags, CLIENT_FLAG_HIDDEN);
- setWMState (dpy, c->window, NormalState);
- workspaceUpdateArea (margins, gnome_margins);
+ setWMState (md->dpy, c->window, NormalState);
+ workspaceUpdateArea (md->margins, md->gnome_margins);
}
myXUngrabServer ();
clientSetNetState (c);
@@ -1883,8 +1883,8 @@ clientHideSingle (Client * c, gboolean change_state)
myXGrabServer ();
TRACE ("hiding client \"%s\" (0x%lx)", c->name, c->window);
clientPassFocus(c);
- XUnmapWindow (dpy, c->window);
- XUnmapWindow (dpy, c->frame);
+ XUnmapWindow (md->dpy, c->window);
+ XUnmapWindow (md->dpy, c->frame);
if (FLAG_TEST (c->flags, CLIENT_FLAG_VISIBLE))
{
FLAG_UNSET (c->flags, CLIENT_FLAG_VISIBLE);
@@ -1893,8 +1893,8 @@ clientHideSingle (Client * c, gboolean change_state)
if (change_state)
{
FLAG_SET (c->flags, CLIENT_FLAG_HIDDEN);
- setWMState (dpy, c->window, IconicState);
- workspaceUpdateArea (margins, gnome_margins);
+ setWMState (md->dpy, c->window, IconicState);
+ workspaceUpdateArea (md->margins, md->gnome_margins);
}
myXUngrabServer ();
clientSetNetState (c);
@@ -1923,8 +1923,8 @@ clientHide (Client * c, int ws, gboolean change_state)
/* ws is used when transitioning between desktops, to avoid
hiding a transient for group that will be shown again on the new
- workspace (transient for groups can be transients for multiple
- ancesors splitted across workspaces...)
+ md->current_ws (transient for groups can be transients for multiple
+ ancesors splitted across md->current_wss...)
*/
if (clientIsTransientOrModalForGroup (c2)
&& clientTransientOrModalHasAncestor (c2, ws))
@@ -2028,7 +2028,7 @@ clientKill (Client * c)
TRACE ("entering clientKill");
TRACE ("killing client \"%s\" (0x%lx)", c->name, c->window);
- XKillClient (dpy, c->window);
+ XKillClient (md->dpy, c->window);
}
void
@@ -2063,7 +2063,7 @@ clientSetLayer (Client * c, int l)
TRACE ("setting client \"%s\" (0x%lx) layer to %d", c2->name,
c2->window, l);
c2->win_layer = l;
- setHint (dpy, c2->window, win_layer, l);
+ setHint (md->dpy, c2->window, win_layer, l);
}
}
g_list_free (list_of_windows);
@@ -2166,11 +2166,11 @@ clientStick (Client * c, gboolean include_transients)
TRACE ("sticking client \"%s\" (0x%lx)", c2->name, c2->window);
c2->win_state |= WIN_STATE_STICKY;
FLAG_SET (c2->flags, CLIENT_FLAG_STICKY);
- setHint (dpy, c2->window, net_wm_desktop,
+ setHint (md->dpy, c2->window, net_wm_desktop,
(unsigned long) ALL_WORKSPACES);
clientSetNetState (c2);
}
- clientSetWorkspace (c, workspace, TRUE);
+ clientSetWorkspace (c, md->current_ws, TRUE);
g_list_free (list_of_windows);
}
else
@@ -2178,10 +2178,10 @@ clientStick (Client * c, gboolean include_transients)
TRACE ("sticking client \"%s\" (0x%lx)", c->name, c->window);
c->win_state |= WIN_STATE_STICKY;
FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
- setHint (dpy, c->window, net_wm_desktop,
+ setHint (md->dpy, c->window, net_wm_desktop,
(unsigned long) ALL_WORKSPACES);
clientSetNetState (c);
- clientSetWorkspace (c, workspace, TRUE);
+ clientSetWorkspace (c, md->current_ws, TRUE);
}
}
@@ -2204,21 +2204,21 @@ clientUnstick (Client * c, gboolean include_transients)
c2 = (Client *) index->data;
c2->win_state &= ~WIN_STATE_STICKY;
FLAG_UNSET (c2->flags, CLIENT_FLAG_STICKY);
- setHint (dpy, c2->window, net_wm_desktop,
- (unsigned long) workspace);
+ setHint (md->dpy, c2->window, net_wm_desktop,
+ (unsigned long) md->current_ws);
clientSetNetState (c2);
}
- clientSetWorkspace (c, workspace, TRUE);
+ clientSetWorkspace (c, md->current_ws, TRUE);
g_list_free (list_of_windows);
}
else
{
c->win_state &= ~WIN_STATE_STICKY;
FLAG_UNSET (c->flags, CLIENT_FLAG_STICKY);
- setHint (dpy, c->window, net_wm_desktop,
- (unsigned long) workspace);
+ setHint (md->dpy, c->window, net_wm_desktop,
+ (unsigned long) md->current_ws);
clientSetNetState (c);
- clientSetWorkspace (c, workspace, TRUE);
+ clientSetWorkspace (c, md->current_ws, TRUE);
}
}
@@ -2313,14 +2313,14 @@ clientToggleMaximized (Client * c, int mode)
cx = frameX (c) + (frameWidth (c) / 2);
cy = frameY (c) + (frameHeight (c) / 2);
- monitor_nbr = gdk_screen_get_monitor_at_point (gscr, cx, cy);
- gdk_screen_get_monitor_geometry (gscr, monitor_nbr, &rect);
+ monitor_nbr = gdk_screen_get_monitor_at_point (md->gscr, cx, cy);
+ gdk_screen_get_monitor_geometry (md->gscr, monitor_nbr, &rect);
full_x = MAX (params.xfwm_margins[LEFT], rect.x);
full_y = MAX (params.xfwm_margins[TOP], rect.y);
- full_w = MIN (gdk_screen_get_width (gscr) - params.xfwm_margins[RIGHT],
+ full_w = MIN (gdk_screen_get_width (md->gscr) - params.xfwm_margins[RIGHT],
rect.x + rect.width) - full_x;
- full_h = MIN (gdk_screen_get_height (gscr) - params.xfwm_margins[BOTTOM],
+ full_h = MIN (gdk_screen_get_height (md->gscr) - params.xfwm_margins[BOTTOM],
rect.y + rect.height) - full_y;
/* Adjust size to the widest size available, not covering struts */
@@ -2385,10 +2385,10 @@ clientToggleMaximized (Client * c, int mode)
grab focus in focus follow mouse mode. Grab the pointer to
avoid these effects
*/
- XGrabPointer (dpy, gnome_win, FALSE, EnterWindowMask, GrabModeAsync,
+ XGrabPointer (md->dpy, md->gnome_win, FALSE, EnterWindowMask, GrabModeAsync,
GrabModeAsync, None, None, GDK_CURRENT_TIME);
clientConfigure (c, &wc, CWX | CWY | CWWidth | CWHeight, CFG_NOTIFY);
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
}
else
{
@@ -2434,12 +2434,12 @@ clientDrawOutline (Client * c)
{
TRACE ("entering clientDrawOutline");
- XDrawRectangle (dpy, root, params.box_gc, frameX (c), frameY (c),
+ XDrawRectangle (md->dpy, md->xroot, params.box_gc, frameX (c), frameY (c),
frameWidth (c) - 1, frameHeight (c) - 1);
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
CLIENT_FLAG_FULLSCREEN | CLIENT_FLAG_SHADED))
{
- XDrawRectangle (dpy, root, params.box_gc, c->x, c->y, c->width - 1,
+ XDrawRectangle (md->dpy, md->xroot, params.box_gc, c->x, c->y, c->width - 1,
c->height - 1);
}
}
@@ -2481,8 +2481,8 @@ clientSnapPosition (Client * c)
best_frame_x = frame_x;
best_frame_y = frame_y;
- monitor_nbr = gdk_screen_get_monitor_at_point (gscr, cx, cy);
- gdk_screen_get_monitor_geometry (gscr, monitor_nbr, &rect);
+ monitor_nbr = gdk_screen_get_monitor_at_point (md->gscr, cx, cy);
+ gdk_screen_get_monitor_geometry (md->gscr, monitor_nbr, &rect);
disp_x = rect.x;
disp_y = rect.y;
@@ -2637,7 +2637,7 @@ clientMove_event_filter (XEvent * xevent, gpointer data)
{
if (passdata->use_keys)
{
- if (IsModifierKey (XKeycodeToKeysym (dpy, xevent->xkey.keycode, 0)))
+ if (IsModifierKey (XKeycodeToKeysym (md->dpy, xevent->xkey.keycode, 0)))
{
moving = FALSE;
}
@@ -2645,7 +2645,7 @@ clientMove_event_filter (XEvent * xevent, gpointer data)
}
else if (xevent->type == MotionNotify)
{
- while (XCheckMaskEvent (dpy, ButtonMotionMask | PointerMotionMask, xevent))
+ while (XCheckMaskEvent (md->dpy, ButtonMotionMask | PointerMotionMask, xevent))
; /* Skip event */
if (xevent->type == ButtonRelease)
@@ -2673,7 +2673,7 @@ clientMove_event_filter (XEvent * xevent, gpointer data)
msx = xevent->xmotion.x_root;
msy = xevent->xmotion.y_root;
- max = gdk_screen_get_width (gscr) - 1;
+ max = gdk_screen_get_width (md->gscr) - 1;
if ((msx == 0) || (msx == max))
{
@@ -2688,16 +2688,16 @@ clientMove_event_filter (XEvent * xevent, gpointer data)
edge_scroll_x = 0;
if (msx == 0)
{
- XWarpPointer (dpy, None, root, 0, 0, 0, 0, max - 10,
+ XWarpPointer (md->dpy, None, md->xroot, 0, 0, 0, 0, max - 10,
msy);
msx = xevent->xmotion.x_root = max - 10;
- workspaceSwitch (workspace - 1, c);
+ workspaceSwitch (md->current_ws - 1, c);
}
else if (msx == max)
{
- XWarpPointer (dpy, None, root, 0, 0, 0, 0, 10, msy);
+ XWarpPointer (md->dpy, None, md->xroot, 0, 0, 0, 0, 10, msy);
msx = xevent->xmotion.x_root = 10;
- workspaceSwitch (workspace + 1, c);
+ workspaceSwitch (md->current_ws + 1, c);
}
}
}
@@ -2792,8 +2792,8 @@ clientMove (Client * c, XEvent * e)
passdata.tmp_event_window =
setTmpEventWin (0, 0,
- gdk_screen_get_width (gscr),
- gdk_screen_get_height (gscr),
+ gdk_screen_get_width (md->gscr),
+ gdk_screen_get_height (md->gscr),
ButtonMotionMask | ButtonReleaseMask);
if (e->type == KeyPress)
@@ -2811,12 +2811,12 @@ clientMove (Client * c, XEvent * e)
}
else
{
- cursor = move_cursor;
- getMouseXY (root, &passdata.mx, &passdata.my);
+ cursor = md->move_cursor;
+ getMouseXY (md->xroot, &passdata.mx, &passdata.my);
}
- g1 = XGrabKeyboard (dpy, passdata.tmp_event_window, FALSE,
+ g1 = XGrabKeyboard (md->dpy, passdata.tmp_event_window, FALSE,
GrabModeAsync, GrabModeAsync, GDK_CURRENT_TIME);
- g2 = XGrabPointer (dpy, passdata.tmp_event_window, FALSE,
+ g2 = XGrabPointer (md->dpy, passdata.tmp_event_window, FALSE,
ButtonMotionMask | ButtonReleaseMask, GrabModeAsync,
GrabModeAsync, None, cursor, GDK_CURRENT_TIME);
@@ -2826,11 +2826,11 @@ clientMove (Client * c, XEvent * e)
gdk_beep ();
if ((passdata.use_keys) && (g1 == GrabSuccess))
{
- XUngrabKeyboard (dpy, GDK_CURRENT_TIME);
+ XUngrabKeyboard (md->dpy, GDK_CURRENT_TIME);
}
if (g2 == GrabSuccess)
{
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
}
removeTmpEventWin (passdata.tmp_event_window);
return;
@@ -2844,13 +2844,13 @@ clientMove (Client * c, XEvent * e)
FLAG_SET (c->flags, CLIENT_FLAG_MOVING_RESIZING);
TRACE ("entering move loop");
- pushEventFilter (clientMove_event_filter, &passdata);
+ pushEventFilter (md->gtox_data, clientMove_event_filter, &passdata);
if (passdata.use_keys)
{
- XPutBackEvent (dpy, e);
+ XPutBackEvent (md->dpy, e);
}
gtk_main ();
- popEventFilter ();
+ popEventFilter (md->gtox_data);
TRACE ("leaving move loop");
FLAG_UNSET (c->flags, CLIENT_FLAG_MOVING_RESIZING);
#ifdef SHOW_POSITION
@@ -2868,8 +2868,8 @@ clientMove (Client * c, XEvent * e)
wc.y = c->y;
clientConfigure (c, &wc, CWX | CWY, NO_CFG_FLAG);
- XUngrabKeyboard (dpy, GDK_CURRENT_TIME);
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabKeyboard (md->dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
removeTmpEventWin (passdata.tmp_event_window);
if (passdata.grab && params.box_move)
@@ -2907,8 +2907,8 @@ clientResize_event_filter (XEvent * xevent, gpointer data)
cx = frame_x + (frame_width / 2);
cy = frame_y + (frame_height / 2);
- monitor_nbr = gdk_screen_get_monitor_at_point (gscr, cx, cy);
- gdk_screen_get_monitor_geometry (gscr, monitor_nbr, &rect);
+ monitor_nbr = gdk_screen_get_monitor_at_point (md->gscr, cx, cy);
+ gdk_screen_get_monitor_geometry (md->gscr, monitor_nbr, &rect);
disp_x = rect.x;
disp_y = rect.y;
@@ -2983,12 +2983,12 @@ clientResize_event_filter (XEvent * xevent, gpointer data)
else
{
if ((c->x + c->width < disp_x + CLIENT_MIN_VISIBLE)
- || (c->x + c->width < margins [LEFT] + CLIENT_MIN_VISIBLE))
+ || (c->x + c->width < md->margins [LEFT] + CLIENT_MIN_VISIBLE))
{
c->width = prev_width;
}
if ((c->y + c->height < disp_y + CLIENT_MIN_VISIBLE)
- || (c->y + c->height < margins [TOP] + CLIENT_MIN_VISIBLE))
+ || (c->y + c->height < md->margins [TOP] + CLIENT_MIN_VISIBLE))
{
c->height = prev_height;
}
@@ -3015,7 +3015,7 @@ clientResize_event_filter (XEvent * xevent, gpointer data)
{
if (passdata->use_keys)
{
- if (IsModifierKey (XKeycodeToKeysym (dpy, xevent->xkey.keycode, 0)))
+ if (IsModifierKey (XKeycodeToKeysym (md->dpy, xevent->xkey.keycode, 0)))
{
resizing = FALSE;
}
@@ -3023,7 +3023,7 @@ clientResize_event_filter (XEvent * xevent, gpointer data)
}
else if (xevent->type == MotionNotify)
{
- while (XCheckMaskEvent (dpy, ButtonMotionMask | PointerMotionMask, xevent))
+ while (XCheckMaskEvent (md->dpy, ButtonMotionMask | PointerMotionMask, xevent))
; /* Skip event */
if (xevent->type == ButtonRelease)
@@ -3107,8 +3107,8 @@ clientResize_event_filter (XEvent * xevent, gpointer data)
|| (passdata->corner == CORNER_TOP_RIGHT))
{
if ((c->y > disp_max_y - CLIENT_MIN_VISIBLE)
- || (c->y > gdk_screen_get_height (gscr)
- - margins [BOTTOM] - CLIENT_MIN_VISIBLE))
+ || (c->y > gdk_screen_get_height (md->gscr)
+ - md->margins [BOTTOM] - CLIENT_MIN_VISIBLE))
{
c->y = prev_y;
c->height = prev_height;
@@ -3119,7 +3119,7 @@ clientResize_event_filter (XEvent * xevent, gpointer data)
|| (passdata->corner == 4 + SIDE_BOTTOM))
{
if ((c->y + c->height < disp_y + CLIENT_MIN_VISIBLE)
- || (c->y + c->height < margins [TOP] + CLIENT_MIN_VISIBLE))
+ || (c->y + c->height < md->margins [TOP] + CLIENT_MIN_VISIBLE))
{
c->height = prev_height;
}
@@ -3129,8 +3129,8 @@ clientResize_event_filter (XEvent * xevent, gpointer data)
|| (passdata->corner == 4 + SIDE_LEFT))
{
if ((c->x > disp_max_x - CLIENT_MIN_VISIBLE)
- || (c->x > gdk_screen_get_width (gscr)
- - margins [RIGHT] - CLIENT_MIN_VISIBLE))
+ || (c->x > gdk_screen_get_width (md->gscr)
+ - md->margins [RIGHT] - CLIENT_MIN_VISIBLE))
{
c->x = prev_x;
c->width = prev_width;
@@ -3141,7 +3141,7 @@ clientResize_event_filter (XEvent * xevent, gpointer data)
|| (passdata->corner == 4 + SIDE_RIGHT))
{
if ((c->x + c->width < disp_x + CLIENT_MIN_VISIBLE)
- || (c->x + c->width < margins [LEFT] + CLIENT_MIN_VISIBLE))
+ || (c->x + c->width < md->margins [LEFT] + CLIENT_MIN_VISIBLE))
{
c->width = prev_width;
}
@@ -3219,8 +3219,8 @@ clientResize (Client * c, int corner, XEvent * e)
passdata.corner = corner;
passdata.tmp_event_window =
setTmpEventWin (0, 0,
- gdk_screen_get_width (gscr),
- gdk_screen_get_height (gscr),
+ gdk_screen_get_width (md->gscr),
+ gdk_screen_get_height (md->gscr),
ButtonMotionMask | ButtonReleaseMask);
if (FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED))
@@ -3241,13 +3241,13 @@ clientResize (Client * c, int corner, XEvent * e)
}
else
{
- getMouseXY (root, &passdata.mx, &passdata.my);
+ getMouseXY (md->xroot, &passdata.mx, &passdata.my);
}
- g1 = XGrabKeyboard (dpy, passdata.tmp_event_window, FALSE,
+ g1 = XGrabKeyboard (md->dpy, passdata.tmp_event_window, FALSE,
GrabModeAsync, GrabModeAsync, GDK_CURRENT_TIME);
- g2 = XGrabPointer (dpy, passdata.tmp_event_window, FALSE,
+ g2 = XGrabPointer (md->dpy, passdata.tmp_event_window, FALSE,
ButtonMotionMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync,
- None, resize_cursor[passdata.corner], GDK_CURRENT_TIME);
+ None, md->resize_cursor[passdata.corner], GDK_CURRENT_TIME);
if (((passdata.use_keys) && (g1 != GrabSuccess)) || (g2 != GrabSuccess))
{
@@ -3255,11 +3255,11 @@ clientResize (Client * c, int corner, XEvent * e)
gdk_beep ();
if ((passdata.use_keys) && (g1 == GrabSuccess))
{
- XUngrabKeyboard (dpy, GDK_CURRENT_TIME);
+ XUngrabKeyboard (md->dpy, GDK_CURRENT_TIME);
}
if (g2 == GrabSuccess)
{
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
}
removeTmpEventWin (passdata.tmp_event_window);
return;
@@ -3282,13 +3282,13 @@ clientResize (Client * c, int corner, XEvent * e)
FLAG_SET (c->flags, CLIENT_FLAG_MOVING_RESIZING);
TRACE ("entering resize loop");
- pushEventFilter (clientResize_event_filter, &passdata);
+ pushEventFilter (md->gtox_data, clientResize_event_filter, &passdata);
if (passdata.use_keys)
{
- XPutBackEvent (dpy, e);
+ XPutBackEvent (md->dpy, e);
}
gtk_main ();
- popEventFilter ();
+ popEventFilter (md->gtox_data);
TRACE ("leaving resize loop");
FLAG_UNSET (c->flags, CLIENT_FLAG_MOVING_RESIZING);
@@ -3307,8 +3307,8 @@ clientResize (Client * c, int corner, XEvent * e)
wc.height = c->height;
clientConfigure (c, &wc, CWX | CWY | CWHeight | CWWidth, CFG_NOTIFY);
- XUngrabKeyboard (dpy, GDK_CURRENT_TIME);
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabKeyboard (md->dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
removeTmpEventWin (passdata.tmp_event_window);
if (passdata.grab && params.box_resize)
@@ -3374,7 +3374,7 @@ clientCycle_event_filter (XEvent * xevent, gpointer data)
break;
case KeyRelease:
{
- int keysym = XKeycodeToKeysym (dpy, xevent->xkey.keycode, 0);
+ int keysym = XKeycodeToKeysym (md->dpy, xevent->xkey.keycode, 0);
/* If KEY_CYCE_WINDOWS has Shift, then stop cycling on Shift
* release.
@@ -3417,9 +3417,9 @@ clientCycle (Client * c, XEvent * e)
g_return_if_fail (c != NULL);
TRACE ("entering clientCycle");
- g1 = XGrabKeyboard (dpy, gnome_win, FALSE, GrabModeAsync, GrabModeAsync,
+ g1 = XGrabKeyboard (md->dpy, md->gnome_win, FALSE, GrabModeAsync, GrabModeAsync,
GDK_CURRENT_TIME);
- g2 = XGrabPointer (dpy, gnome_win, FALSE, NoEventMask, GrabModeAsync,
+ g2 = XGrabPointer (md->dpy, md->gnome_win, FALSE, NoEventMask, GrabModeAsync,
GrabModeAsync, None, None, GDK_CURRENT_TIME);
if ((g1 != GrabSuccess) || (g2 != GrabSuccess))
{
@@ -3427,11 +3427,11 @@ clientCycle (Client * c, XEvent * e)
gdk_beep ();
if (g1 == GrabSuccess)
{
- XUngrabKeyboard (dpy, GDK_CURRENT_TIME);
+ XUngrabKeyboard (md->dpy, GDK_CURRENT_TIME);
}
if (g2 == GrabSuccess)
{
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
}
return;
}
@@ -3452,9 +3452,9 @@ clientCycle (Client * c, XEvent * e)
TRACE ("entering cycle loop");
/* Draw frame draw */
clientDrawOutline (passdata.c);
- pushEventFilter (clientCycle_event_filter, &passdata);
+ pushEventFilter (md->gtox_data, clientCycle_event_filter, &passdata);
gtk_main ();
- popEventFilter ();
+ popEventFilter (md->gtox_data);
if (passdata.c)
{
/* Hide frame draw */
@@ -3465,8 +3465,8 @@ clientCycle (Client * c, XEvent * e)
g_free (passdata.tabwin);
}
myXUngrabServer ();
- XUngrabKeyboard (dpy, GDK_CURRENT_TIME);
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabKeyboard (md->dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
if (passdata.c)
{
@@ -3539,7 +3539,7 @@ clientButtonPress (Client * c, Window w, XButtonEvent * bev)
}
}
- g1 = XGrabPointer (dpy, w, FALSE,
+ g1 = XGrabPointer (md->dpy, w, FALSE,
ButtonReleaseMask | EnterWindowMask | LeaveWindowMask, GrabModeAsync,
GrabModeAsync, None, None, GDK_CURRENT_TIME);
@@ -3549,7 +3549,7 @@ clientButtonPress (Client * c, Window w, XButtonEvent * bev)
gdk_beep ();
if (g1 == GrabSuccess)
{
- XUngrabKeyboard (dpy, GDK_CURRENT_TIME);
+ XUngrabKeyboard (md->dpy, GDK_CURRENT_TIME);
}
return;
}
@@ -3561,12 +3561,12 @@ clientButtonPress (Client * c, Window w, XButtonEvent * bev)
frameDraw (c, FALSE, FALSE);
TRACE ("entering button press loop");
- pushEventFilter (clientButtonPress_event_filter, &passdata);
+ pushEventFilter (md->gtox_data, clientButtonPress_event_filter, &passdata);
gtk_main ();
- popEventFilter ();
+ popEventFilter (md->gtox_data);
TRACE ("leaving button press loop");
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
if (c->button_pressed[b])
{
diff --git a/src/client.h b/src/client.h
index afb6a8ae3..a953e56a8 100644
--- a/src/client.h
+++ b/src/client.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
@@ -130,20 +130,20 @@
#define WM_FLAG_CONTEXT_HELP (1L<<3)
#define CLIENT_FLAG_INITIAL_VALUES CLIENT_FLAG_HAS_BORDER | \
- CLIENT_FLAG_HAS_MENU | \
- CLIENT_FLAG_HAS_MAXIMIZE | \
- CLIENT_FLAG_HAS_STICK | \
- CLIENT_FLAG_HAS_HIDE | \
- CLIENT_FLAG_HAS_CLOSE | \
- CLIENT_FLAG_HAS_MOVE | \
- CLIENT_FLAG_HAS_RESIZE
+ CLIENT_FLAG_HAS_MENU | \
+ CLIENT_FLAG_HAS_MAXIMIZE | \
+ CLIENT_FLAG_HAS_STICK | \
+ CLIENT_FLAG_HAS_HIDE | \
+ CLIENT_FLAG_HAS_CLOSE | \
+ CLIENT_FLAG_HAS_MOVE | \
+ CLIENT_FLAG_HAS_RESIZE
#define ALL_WORKSPACES (int) 0xFFFFFFFF
#define CONSTRAINED_WINDOW(c) ((c->win_layer > WIN_LAYER_DESKTOP) && \
- (c->win_layer < WIN_LAYER_ABOVE_DOCK) && \
- !(c->type & (WINDOW_DESKTOP | WINDOW_DOCK)) && \
- !(c->legacy_fullscreen))
+ (c->win_layer < WIN_LAYER_ABOVE_DOCK) && \
+ !(c->type & (WINDOW_DESKTOP | WINDOW_DOCK)) && \
+ !(c->legacy_fullscreen))
#define WINDOW_TYPE_DIALOG (WINDOW_DIALOG | WINDOW_MODAL_DIALOG)
#define WINDOW_TYPE_DONT_PLACE (WINDOW_DESKTOP | WINDOW_DOCK | WINDOW_SPLASHSCREEN)
diff --git a/src/events.c b/src/events.c
index d1520bd31..fdac1220a 100644
--- a/src/events.c
+++ b/src/events.c
@@ -104,8 +104,8 @@ typeOfClick (Window w, XEvent * ev, gboolean allow_double_click)
g_return_val_if_fail (ev != NULL, XFWM_BUTTON_UNDEFINED);
g_return_val_if_fail (w != None, XFWM_BUTTON_UNDEFINED);
- XFlush (dpy);
- g = XGrabPointer (dpy, w, FALSE, DBL_CLICK_GRAB, GrabModeAsync,
+ XFlush (md->dpy);
+ g = XGrabPointer (md->dpy, w, FALSE, DBL_CLICK_GRAB, GrabModeAsync,
GrabModeAsync, None, None, ev->xbutton.time);
if (g != GrabSuccess)
{
@@ -127,11 +127,11 @@ typeOfClick (Window w, XEvent * ev, gboolean allow_double_click)
{
g_usleep (10000);
total += 10;
- if (XCheckMaskEvent (dpy, FocusChangeMask, ev))
+ if (XCheckMaskEvent (md->dpy, FocusChangeMask, ev))
{
handleEvent (ev);
}
- if (XCheckMaskEvent (dpy, ButtonReleaseMask | ButtonPressMask, ev))
+ if (XCheckMaskEvent (md->dpy, ButtonReleaseMask | ButtonPressMask, ev))
{
if (ev->xbutton.button == button)
{
@@ -144,14 +144,14 @@ typeOfClick (Window w, XEvent * ev, gboolean allow_double_click)
{
break;
}
- if (XCheckMaskEvent (dpy, ButtonMotionMask | PointerMotionMask, ev))
+ if (XCheckMaskEvent (md->dpy, ButtonMotionMask | PointerMotionMask, ev))
{
xcurrent = ev->xmotion.x_root;
ycurrent = ev->xmotion.y_root;
}
}
- XUngrabPointer (dpy, ev->xbutton.time);
- XFlush (dpy);
+ XUngrabPointer (md->dpy, ev->xbutton.time);
+ XFlush (md->dpy);
return (XfwmButtonClickType) clicks;
}
@@ -249,7 +249,7 @@ handleMotionNotify (XMotionEvent * ev)
{
msx = ev->x_root;
msy = ev->y_root;
- max = gdk_screen_get_width (gscr) - 1;
+ max = gdk_screen_get_width (md->gscr) - 1;
if ((msx == 0) || (msx == max))
{
@@ -264,15 +264,15 @@ handleMotionNotify (XMotionEvent * ev)
edge_scroll_x = 0;
if (msx == 0)
{
- XWarpPointer (dpy, None, root, 0, 0, 0, 0, max - 10, msy);
- workspaceSwitch (workspace - 1, NULL);
+ XWarpPointer (md->dpy, None, md->xroot, 0, 0, 0, 0, max - 10, msy);
+ workspaceSwitch (md->current_ws - 1, NULL);
}
else if (msx == max)
{
- XWarpPointer (dpy, None, root, 0, 0, 0, 0, 10, msy);
- workspaceSwitch (workspace + 1, NULL);
+ XWarpPointer (md->dpy, None, md->xroot, 0, 0, 0, 0, 10, msy);
+ workspaceSwitch (md->current_ws + 1, NULL);
}
- while (XCheckWindowEvent(dpy, ev->window, PointerMotionMask, (XEvent *) ev))
+ while (XCheckWindowEvent(md->dpy, ev->window, PointerMotionMask, (XEvent *) ev))
; /* Skip event */
}
}
@@ -347,7 +347,7 @@ handleKeyPress (XKeyEvent * ev)
{
clientToggleSticky (c, TRUE);
frameDraw (c, FALSE, FALSE);
- }
+ }
break;
case KEY_RAISE_WINDOW:
clientRaise (c);
@@ -358,10 +358,10 @@ handleKeyPress (XKeyEvent * ev)
clientPassGrabButton1 (NULL);
break;
case KEY_MOVE_NEXT_WORKSPACE:
- workspaceSwitch (workspace + 1, c);
+ workspaceSwitch (md->current_ws + 1, c);
break;
case KEY_MOVE_PREV_WORKSPACE:
- workspaceSwitch (workspace - 1, c);
+ workspaceSwitch (md->current_ws - 1, c);
break;
case KEY_MOVE_WORKSPACE_1:
case KEY_MOVE_WORKSPACE_2:
@@ -396,10 +396,10 @@ handleKeyPress (XKeyEvent * ev)
switch (key)
{
case KEY_NEXT_WORKSPACE:
- workspaceSwitch (workspace + 1, NULL);
+ workspaceSwitch (md->current_ws + 1, NULL);
break;
case KEY_PREV_WORKSPACE:
- workspaceSwitch (workspace - 1, NULL);
+ workspaceSwitch (md->current_ws - 1, NULL);
break;
case KEY_ADD_WORKSPACE:
workspaceSetCount (params.workspace_count + 1);
@@ -557,11 +557,10 @@ titleButton (Client * c, int state, XButtonEvent * ev)
ev->window = ev->root;
if (button_handler_id)
{
- g_signal_handler_disconnect (GTK_OBJECT (getDefaultGtkWidget
- ()), button_handler_id);
+ g_signal_handler_disconnect (GTK_OBJECT (getDefaultGtkWidget (md->gtox_data)), button_handler_id);
}
button_handler_id =
- g_signal_connect (GTK_OBJECT (getDefaultGtkWidget ()),
+ g_signal_connect (GTK_OBJECT (getDefaultGtkWidget (md->gtox_data)),
"button_press_event", GTK_SIGNAL_FUNC (show_popup_cb),
(gpointer) c);
/* Let GTK handle this for us. */
@@ -598,11 +597,11 @@ rootScrollButton (XButtonEvent * ev)
lastscroll = ev->time;
if (ev->button == Button4)
{
- workspaceSwitch (workspace - 1, NULL);
+ workspaceSwitch (md->current_ws - 1, NULL);
}
else if (ev->button == Button5)
{
- workspaceSwitch (workspace + 1, NULL);
+ workspaceSwitch (md->current_ws + 1, NULL);
}
}
@@ -700,11 +699,10 @@ handleButtonPress (XButtonEvent * ev)
ev->window = ev->root;
if (button_handler_id)
{
- g_signal_handler_disconnect (GTK_OBJECT
- (getDefaultGtkWidget ()), button_handler_id);
+ g_signal_handler_disconnect (GTK_OBJECT (getDefaultGtkWidget (md->gtox_data)), button_handler_id);
}
button_handler_id =
- g_signal_connect (GTK_OBJECT (getDefaultGtkWidget ()),
+ g_signal_connect (GTK_OBJECT (getDefaultGtkWidget (md->gtox_data)),
"button_press_event", GTK_SIGNAL_FUNC (show_popup_cb),
(gpointer) c);
/* Let GTK handle this for us. */
@@ -776,22 +774,22 @@ handleButtonPress (XButtonEvent * ev)
if (replay)
{
- XAllowEvents (dpy, ReplayPointer, ev->time);
+ XAllowEvents (md->dpy, ReplayPointer, ev->time);
}
else
{
- XAllowEvents (dpy, SyncPointer, ev->time);
+ XAllowEvents (md->dpy, SyncPointer, ev->time);
}
}
- else if ((ev->window == root) && ((ev->button == Button4)
+ else if ((ev->window == md->xroot) && ((ev->button == Button4)
|| (ev->button == Button5)))
{
rootScrollButton (ev);
}
else
{
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
- XSendEvent (dpy, gnome_win, FALSE, SubstructureNotifyMask,
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
+ XSendEvent (md->dpy, md->gnome_win, FALSE, SubstructureNotifyMask,
(XEvent *) ev);
}
}
@@ -801,7 +799,7 @@ handleButtonRelease (XButtonEvent * ev)
{
TRACE ("entering handleButtonRelease");
- XSendEvent (dpy, gnome_win, FALSE, SubstructureNotifyMask, (XEvent *) ev);
+ XSendEvent (md->dpy, md->gnome_win, FALSE, SubstructureNotifyMask, (XEvent *) ev);
}
static void
@@ -812,10 +810,10 @@ handleDestroyNotify (XDestroyWindowEvent * ev)
TRACE ("entering handleDestroyNotify");
TRACE ("DestroyNotify on window (0x%lx)", ev->window);
- if (ev->window == systray)
+ if (ev->window == md->systray)
{
- /* systray window is gone */
- systray = None;
+ /* md->systray window is gone */
+ md->systray = None;
return;
}
@@ -853,7 +851,7 @@ handleMapRequest (XMapRequestEvent * ev)
}
clientShow (c, TRUE);
if (FLAG_TEST (c->flags, CLIENT_FLAG_STICKY) ||
- (c->win_workspace == workspace))
+ (c->win_workspace == md->current_ws))
{
clientFocusNew(c);
}
@@ -898,7 +896,7 @@ handleUnmapNotify (XUnmapEvent * ev)
return;
}
- if ((ev->event != ev->window) && (ev->event != root || !ev->send_event))
+ if ((ev->event != ev->window) && (ev->event != md->xroot || !ev->send_event))
{
TRACE ("handleUnmapNotify (): Event ignored");
return;
@@ -926,12 +924,12 @@ handleUnmapNotify (XUnmapEvent * ev)
/*
* ICCCM spec states that a client wishing to switch
* to WithdrawnState should send a synthetic UnmapNotify
- * with the event field set to root if the client window
+ * with the event field set to md->xroot if the client window
* is already unmapped.
* Therefore, bypass the ignore_unmap counter and
* unframe the client.
*/
- if ((ev->event == root) && (ev->send_event))
+ if ((ev->event == md->xroot) && (ev->send_event))
{
TRACE ("ICCCM UnmapNotify for \"%s\"", c->name);
clientUnframe (c, FALSE);
@@ -955,14 +953,14 @@ handleConfigureNotify (XConfigureEvent * ev)
{
TRACE ("entering handleConfigureNotify");
- if (ev->window == root)
+ if (ev->window == md->xroot)
{
- TRACE ("ConfigureNotify on the root win (0x%lx)", ev->window);
+ TRACE ("ConfigureNotify on the md->xroot win (0x%lx)", ev->window);
#ifdef HAVE_RANDR
XRRUpdateConfiguration (ev);
#else
- xscreen->width = ev->width;
- xscreen->height = ev->height;
+ md->xscreen->width = ev->width;
+ md->xscreen->height = ev->height;
#endif
placeSidewalks (params.wrap_workspaces);
clientScreenResize ();
@@ -980,7 +978,7 @@ handleConfigureRequest (XConfigureRequestEvent * ev)
TRACE ("ConfigureRequest on window (0x%lx)", ev->window);
/* Compress events - logic taken from kwin */
- while (XCheckTypedWindowEvent (dpy, ev->window, ConfigureRequest, &otherEvent))
+ while (XCheckTypedWindowEvent (md->dpy, ev->window, ConfigureRequest, &otherEvent))
{
if (otherEvent.xconfigurerequest.value_mask == ev->value_mask)
{
@@ -988,7 +986,7 @@ handleConfigureRequest (XConfigureRequestEvent * ev)
}
else
{
- XPutBackEvent (dpy, &otherEvent);
+ XPutBackEvent (md->dpy, &otherEvent);
break;
}
}
@@ -1060,8 +1058,8 @@ handleConfigureRequest (XConfigureRequestEvent * ev)
cx = frameX (c) + (frameWidth (c) / 2);
cy = frameY (c) + (frameHeight (c) / 2);
- monitor_nbr = gdk_screen_get_monitor_at_point (gscr, cx, cy);
- gdk_screen_get_monitor_geometry (gscr, monitor_nbr, &rect);
+ monitor_nbr = gdk_screen_get_monitor_at_point (md->gscr, cx, cy);
+ gdk_screen_get_monitor_geometry (md->gscr, monitor_nbr, &rect);
wc.x = rect.x;
wc.y = rect.y;
@@ -1104,7 +1102,7 @@ handleConfigureRequest (XConfigureRequestEvent * ev)
/* Let's say that if the client performs a XRaiseWindow, we show the window if hidden */
if ((ev->value_mask & CWStackMode) && (wc.stack_mode == Above))
{
- if ((c->win_workspace == workspace) ||
+ if ((c->win_workspace == md->current_ws) ||
(FLAG_TEST (c->flags, CLIENT_FLAG_STICKY)))
{
if (FLAG_TEST (c->flags, CLIENT_FLAG_HIDDEN))
@@ -1120,7 +1118,7 @@ handleConfigureRequest (XConfigureRequestEvent * ev)
else
{
TRACE ("unmanaged configure request for win 0x%lx", ev->window);
- XConfigureWindow (dpy, ev->window, ev->value_mask, &wc);
+ XConfigureWindow (md->dpy, ev->window, ev->value_mask, &wc);
}
}
@@ -1167,7 +1165,7 @@ handleLeaveNotify (XCrossingEvent * ev)
return;
}
- if ((ev->window == sidewalk[0]) || (ev->window == sidewalk[1]))
+ if ((ev->window == md->sidewalk[0]) || (ev->window == md->sidewalk[1]))
{
TRACE ("Reset edge_scroll_x");
edge_scroll_x = 0;
@@ -1207,11 +1205,11 @@ handleFocusIn (XFocusChangeEvent * ev)
"NotifyDetailNone" :
"(unknown)");
- if ((ev->window == root) && (ev->mode == NotifyNormal) &&
+ if ((ev->window == md->xroot) && (ev->mode == NotifyNormal) &&
(ev->detail == NotifyDetailNone))
{
- /* Handle focus transition to root (means that an unknown
- window has vanished and the focus is returned to the root
+ /* Handle focus transition to md->xroot (means that an unknown
+ window has vanished and the focus is returned to the md->xroot
*/
c = clientGetFocus ();
if (c)
@@ -1317,7 +1315,7 @@ handlePropertyNotify (XPropertyEvent * ev)
{
free (c->name);
}
- getWindowName (dpy, c->window, &c->name);
+ getWindowName (md->dpy, c->window, &c->name);
FLAG_SET (c->flags, CLIENT_FLAG_NAME_CHANGED);
frameDraw (c, TRUE, FALSE);
}
@@ -1332,7 +1330,7 @@ handlePropertyNotify (XPropertyEvent * ev)
{
TRACE ("client \"%s\" (0x%lx) has received a XA_WM_HINTS notify",
c->name, c->window);
- c->wmhints = XGetWMHints (dpy, c->window);
+ c->wmhints = XGetWMHints (md->dpy, c->window);
if (c->wmhints)
{
if (c->wmhints->flags & WindowGroupHint)
@@ -1352,7 +1350,7 @@ handlePropertyNotify (XPropertyEvent * ev)
{
TRACE ("client \"%s\" (0x%lx) has received a win_hints notify",
c->name, c->window);
- getHint (dpy, c->window, win_hints, &c->win_hints);
+ getHint (md->dpy, c->window, win_hints, &c->win_hints);
}
else if (ev->atom == net_wm_window_type)
{
@@ -1378,7 +1376,7 @@ handlePropertyNotify (XPropertyEvent * ev)
}
else if (ev->atom == net_wm_user_time)
{
- if (getNetWMUserTime (dpy, c->window, &c->user_time))
+ if (getNetWMUserTime (md->dpy, c->window, &c->user_time))
{
FLAG_SET (c->flags, CLIENT_FLAG_HAS_USER_TIME);
}
@@ -1391,7 +1389,7 @@ handlePropertyNotify (XPropertyEvent * ev)
free (c->startup_id);
c->startup_id = NULL;
}
- getWindowStartupId (dpy, c->window, &c->startup_id);
+ getWindowStartupId (md->dpy, c->window, &c->startup_id);
}
#endif
@@ -1399,7 +1397,7 @@ handlePropertyNotify (XPropertyEvent * ev)
else if (ev->atom == net_desktop_names)
{
TRACE ("root has received a net_desktop_names notify");
- if (getUTF8String (dpy, root, net_desktop_names, &names, &length))
+ if (getUTF8String (md->dpy, md->xroot, net_desktop_names, &names, &length))
{
workspaceSetNames (names, length);
}
@@ -1407,8 +1405,8 @@ handlePropertyNotify (XPropertyEvent * ev)
else if (ev->atom == gnome_panel_desktop_area)
{
TRACE ("root has received a gnome_panel_desktop_area notify");
- getGnomeDesktopMargins (dpy, screen, gnome_margins);
- workspaceUpdateArea (margins, gnome_margins);
+ getGnomeDesktopMargins (md->dpy, md->screen, md->gnome_margins);
+ workspaceUpdateArea (md->margins, md->gnome_margins);
}
}
@@ -1523,7 +1521,7 @@ handleClientMessage (XClientMessageEvent * ev)
TRACE
("client \"%s\" (0x%lx) has received a net_active_window event",
c->name, c->window);
- clientSetWorkspace (c, workspace, TRUE);
+ clientSetWorkspace (c, md->current_ws, TRUE);
clientShow (c, TRUE);
clientRaise (c);
clientSetFocus (c, GDK_CURRENT_TIME, NO_FOCUS_FLAG);
@@ -1538,7 +1536,7 @@ handleClientMessage (XClientMessageEvent * ev)
{
TRACE
("root has received a win_workspace or a net_current_desktop event");
- if (ev->data.l[0] != workspace)
+ if (ev->data.l[0] != md->current_ws)
{
workspaceSwitch (ev->data.l[0], NULL);
}
@@ -1558,14 +1556,14 @@ handleClientMessage (XClientMessageEvent * ev)
&& (ev->format == 32))
{
TRACE ("root has received a net_system_tray_manager event");
- systray = getSystrayWindow (dpy);
+ md->systray = getSystrayWindow (md->dpy);
}
else if ((ev->message_type == net_showing_desktop)
&& (ev->format == 32))
{
TRACE ("root has received a net_showing_desktop event");
clientToggleShowDesktop (ev->data.l[0]);
- setHint (dpy, root, net_showing_desktop, ev->data.l[0]);
+ setHint (md->dpy, md->xroot, net_showing_desktop, ev->data.l[0]);
}
else
{
@@ -1666,19 +1664,19 @@ handleEvent (XEvent * ev)
handleColormapNotify ((XColormapEvent *) ev);
break;
default:
- if (shape && (ev->type == shape_event))
+ if (md->shape && (ev->type == md->shape_event))
{
handleShape ((XShapeEvent *) ev);
}
}
- if (!gdk_events_pending () && !XPending (dpy))
+ if (!gdk_events_pending () && !XPending (md->dpy))
{
- if (reload)
+ if (md->reload)
{
reloadSettings (UPDATE_ALL);
- reload = FALSE;
+ md->reload = FALSE;
}
- else if (quit)
+ else if (md->quit)
{
gtk_main_quit ();
}
@@ -1905,11 +1903,11 @@ show_popup_cb (GtkWidget * widget, GdkEventButton * ev, gpointer data)
if (button_handler_id)
{
- g_signal_handler_disconnect (GTK_OBJECT (getDefaultGtkWidget ()),
+ g_signal_handler_disconnect (GTK_OBJECT (getDefaultGtkWidget (md->gtox_data)),
button_handler_id);
}
button_handler_id =
- g_signal_connect (GTK_OBJECT (getDefaultGtkWidget ()),
+ g_signal_connect (GTK_OBJECT (getDefaultGtkWidget (md->gtox_data)),
"button_press_event", GTK_SIGNAL_FUNC (show_popup_cb),
(gpointer) NULL);
@@ -1930,8 +1928,8 @@ show_popup_cb (GtkWidget * widget, GdkEventButton * ev, gpointer data)
trouble.
*/
menu_event_window = setTmpEventWin (0, 0,
- gdk_screen_get_width (gscr),
- gdk_screen_get_height (gscr),
+ gdk_screen_get_width (md->gscr),
+ gdk_screen_get_height (md->gscr),
NoEventMask);
menu = menu_default (ops, insensitive, menu_callback, c->win_workspace,
@@ -1955,8 +1953,8 @@ static gboolean
set_reload (void)
{
TRACE
- ("setting reload flag so all prefs will be reread at next event loop");
- reload = TRUE;
+ ("setting md->reload flag so all prefs will be reread at next event loop");
+ md->reload = TRUE;
return (TRUE);
}
@@ -2000,10 +1998,10 @@ initGtkCallbacks (void)
GtkSettings *settings;
button_handler_id =
- g_signal_connect (GTK_OBJECT (getDefaultGtkWidget ()),
+ g_signal_connect (GTK_OBJECT (getDefaultGtkWidget (md->gtox_data)),
"button_press_event", GTK_SIGNAL_FUNC (show_popup_cb),
(gpointer) NULL);
- g_signal_connect (GTK_OBJECT (getDefaultGtkWidget ()), "client_event",
+ g_signal_connect (GTK_OBJECT (getDefaultGtkWidget (md->gtox_data)), "client_event",
GTK_SIGNAL_FUNC (client_event_cb), (gpointer) NULL);
settings = gtk_settings_get_default ();
diff --git a/src/events.h b/src/events.h
index f64fcc70f..4ace179d9 100644
--- a/src/events.h
+++ b/src/events.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
diff --git a/src/focus.c b/src/focus.c
index 740bebec0..b0f9d77a9 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
@@ -67,31 +67,31 @@ clientGetTopMostFocusable (int layer, Client * exclude)
top_client.prefered = top_client.highest = NULL;
for (index = windows_stack; index; index = g_list_next (index))
{
- c = (Client *) index->data;
- TRACE ("*** stack window \"%s\" (0x%lx), layer %i", c->name,
- c->window, (int) c->win_layer);
-
- if ((c->type & (WINDOW_SPLASHSCREEN | WINDOW_DOCK | WINDOW_DESKTOP))
- || ((layer != WIN_LAYER_DESKTOP) && (c->type & WINDOW_DESKTOP)))
- {
- continue;
- }
-
- if (!exclude || (c != exclude))
- {
- if ((c->win_layer <= layer) && FLAG_TEST (c->flags, CLIENT_FLAG_VISIBLE))
- {
- if (clientSelectMask (c, 0))
- {
- top_client.prefered = c;
- }
- top_client.highest = c;
- }
- else if (c->win_layer > layer)
- {
- break;
- }
- }
+ c = (Client *) index->data;
+ TRACE ("*** stack window \"%s\" (0x%lx), layer %i", c->name,
+ c->window, (int) c->win_layer);
+
+ if ((c->type & (WINDOW_SPLASHSCREEN | WINDOW_DOCK | WINDOW_DESKTOP))
+ || ((layer != WIN_LAYER_DESKTOP) && (c->type & WINDOW_DESKTOP)))
+ {
+ continue;
+ }
+
+ if (!exclude || (c != exclude))
+ {
+ if ((c->win_layer <= layer) && FLAG_TEST (c->flags, CLIENT_FLAG_VISIBLE))
+ {
+ if (clientSelectMask (c, 0))
+ {
+ top_client.prefered = c;
+ }
+ top_client.highest = c;
+ }
+ else if (c->win_layer > layer)
+ {
+ break;
+ }
+ }
}
return top_client;
@@ -105,11 +105,11 @@ clientFocusTop (int layer)
top_client = clientGetTopMostFocusable (layer, NULL);
if (top_client.prefered)
{
- clientSetFocus (top_client.prefered, GDK_CURRENT_TIME, NO_FOCUS_FLAG);
+ clientSetFocus (top_client.prefered, GDK_CURRENT_TIME, NO_FOCUS_FLAG);
}
else
{
- clientSetFocus (top_client.highest, GDK_CURRENT_TIME, NO_FOCUS_FLAG);
+ clientSetFocus (top_client.highest, GDK_CURRENT_TIME, NO_FOCUS_FLAG);
}
}
@@ -122,31 +122,33 @@ clientFocusNew(Client * c)
if (!clientAcceptFocus (c))
{
- return;
+ return;
}
-
+
+#if 0
/* Try to avoid focus stealing */
if (client_focus)
{
- if (FLAG_TEST(c->flags, CLIENT_FLAG_HAS_USER_TIME) &&
- FLAG_TEST(client_focus->flags, CLIENT_FLAG_HAS_USER_TIME))
- {
+ if (FLAG_TEST(c->flags, CLIENT_FLAG_HAS_USER_TIME) &&
+ FLAG_TEST(client_focus->flags, CLIENT_FLAG_HAS_USER_TIME))
+ {
TRACE ("Current %u, new %u", client_focus->user_time, c->user_time);
- if (c->user_time < client_focus->user_time)
- {
- give_focus = FALSE;
- }
- }
+ if (c->user_time < client_focus->user_time)
+ {
+ give_focus = FALSE;
+ }
+ }
}
+#endif
if (give_focus || FLAG_TEST(c->flags, CLIENT_FLAG_STATE_MODAL))
{
- clientSetFocus (c, GDK_CURRENT_TIME, FOCUS_IGNORE_MODAL);
- clientPassGrabButton1 (c);
+ clientSetFocus (c, GDK_CURRENT_TIME, FOCUS_IGNORE_MODAL);
+ clientPassGrabButton1 (c);
}
else
{
- clientPassGrabButton1 (NULL);
+ clientPassGrabButton1 (NULL);
}
}
@@ -158,25 +160,25 @@ clientSelectMask (Client * c, int mask)
TRACE ("entering clientSelectMask");
if ((!clientAcceptFocus (c)) && !(mask & INCLUDE_SKIP_FOCUS))
{
- okay = FALSE;
+ okay = FALSE;
}
if (FLAG_TEST (c->flags, CLIENT_FLAG_HIDDEN) && !(mask & INCLUDE_HIDDEN))
{
- okay = FALSE;
+ okay = FALSE;
}
if (FLAG_TEST (c->flags, CLIENT_FLAG_SKIP_PAGER)
- && !(mask & INCLUDE_SKIP_PAGER))
+ && !(mask & INCLUDE_SKIP_PAGER))
{
- okay = FALSE;
+ okay = FALSE;
}
if (FLAG_TEST (c->flags, CLIENT_FLAG_SKIP_TASKBAR)
- && !(mask & INCLUDE_SKIP_TASKBAR))
+ && !(mask & INCLUDE_SKIP_TASKBAR))
{
- okay = FALSE;
+ okay = FALSE;
}
- if ((c->win_workspace != workspace) && !(mask & INCLUDE_ALL_WORKSPACES))
+ if ((c->win_workspace != md->current_ws) && !(mask & INCLUDE_ALL_WORKSPACES))
{
- okay = FALSE;
+ okay = FALSE;
}
return okay;
@@ -192,18 +194,18 @@ clientGetNext (Client * c, int mask)
if (c)
{
- for (c2 = c->next, i = 0; (c2) && (i < client_count);
- c2 = c2->next, i++)
- {
- if (c2->type & (WINDOW_SPLASHSCREEN | WINDOW_DOCK | WINDOW_DESKTOP))
- {
- continue;
- }
- if (clientSelectMask (c2, mask))
- {
- return c2;
- }
- }
+ for (c2 = c->next, i = 0; (c2) && (i < client_count);
+ c2 = c2->next, i++)
+ {
+ if (c2->type & (WINDOW_SPLASHSCREEN | WINDOW_DOCK | WINDOW_DESKTOP))
+ {
+ continue;
+ }
+ if (clientSelectMask (c2, mask))
+ {
+ return c2;
+ }
+ }
}
return NULL;
}
@@ -218,18 +220,18 @@ clientGetPrevious (Client * c, int mask)
if (c)
{
- for (c2 = c->prev, i = 0; (c2) && (i < client_count);
- c2 = c2->prev, i++)
- {
- if (c2->type & (WINDOW_SPLASHSCREEN | WINDOW_DOCK | WINDOW_DESKTOP))
- {
- continue;
- }
- if (clientSelectMask (c2, mask))
- {
- return c2;
- }
- }
+ for (c2 = c->prev, i = 0; (c2) && (i < client_count);
+ c2 = c2->prev, i++)
+ {
+ if (c2->type & (WINDOW_SPLASHSCREEN | WINDOW_DOCK | WINDOW_DESKTOP))
+ {
+ continue;
+ }
+ if (clientSelectMask (c2, mask))
+ {
+ return c2;
+ }
+ }
}
return NULL;
}
@@ -250,50 +252,50 @@ clientPassFocus (Client * c)
if (pending_focus)
{
- current_focus = pending_focus;
+ current_focus = pending_focus;
}
if ((c || current_focus) && (c != current_focus))
{
- return;
+ return;
}
top_most = clientGetTopMostFocusable (look_in_layer, c);
if (params.click_to_focus)
{
- if ((c) && clientIsModal (c))
- {
- /* If the window is a modal, send focus back to its parent window
- Modals are transients, and we aren"t interested in modal
- for group, so it safe to sue clientGetTransient because
- it's really what we want...
- */
+ if ((c) && clientIsModal (c))
+ {
+ /* If the window is a modal, send focus back to its parent window
+ Modals are transients, and we aren"t interested in modal
+ for group, so it safe to sue clientGetTransient because
+ it's really what we want...
+ */
- c2 = clientGetTransient (c);
- if (c2 && FLAG_TEST(c2->flags, CLIENT_FLAG_VISIBLE))
- {
- new_focus = c2;
- /* Usability: raise the parent, to grab user's attention */
- clientRaise (c2);
- }
- }
+ c2 = clientGetTransient (c);
+ if (c2 && FLAG_TEST(c2->flags, CLIENT_FLAG_VISIBLE))
+ {
+ new_focus = c2;
+ /* Usability: raise the parent, to grab user's attention */
+ clientRaise (c2);
+ }
+ }
}
- else if (XQueryPointer (dpy, root, &dr, &window, &rx, &ry, &wx, &wy, &mask))
+ else if (XQueryPointer (md->dpy, md->xroot, &dr, &window, &rx, &ry, &wx, &wy, &mask))
{
- new_focus = clientAtPosition (rx, ry, c);
+ new_focus = clientAtPosition (rx, ry, c);
}
if (!new_focus)
{
- new_focus = top_most.prefered ? top_most.prefered : top_most.highest;
+ new_focus = top_most.prefered ? top_most.prefered : top_most.highest;
}
clientSetFocus (new_focus, GDK_CURRENT_TIME, FOCUS_IGNORE_MODAL | FOCUS_FORCE);
if (new_focus == top_most.highest)
{
- clientPassGrabButton1 (new_focus);
+ clientPassGrabButton1 (new_focus);
}
else if (last_ungrab == c)
{
- clientPassGrabButton1 (NULL);
+ clientPassGrabButton1 (NULL);
}
}
@@ -307,16 +309,16 @@ clientAcceptFocus (Client * c)
/* Modal dialogs *always* accept focus */
if (FLAG_TEST(c->flags, CLIENT_FLAG_STATE_MODAL))
{
- return TRUE;
+ return TRUE;
}
/* First check GNOME protocol */
if (c->win_hints & WIN_HINTS_SKIP_FOCUS)
{
- return FALSE;
+ return FALSE;
}
if (!FLAG_TEST (c->wm_flags, WM_FLAG_INPUT | WM_FLAG_TAKEFOCUS))
{
- return FALSE;
+ return FALSE;
}
return TRUE;
@@ -330,13 +332,13 @@ clientSortRing(Client *c)
TRACE ("Sorting...");
if (client_count > 2 && c != clients)
{
- c->prev->next = c->next;
- c->next->prev = c->prev;
+ c->prev->next = c->next;
+ c->next->prev = c->prev;
- c->prev = clients->prev;
- c->next = clients;
- clients->prev->next = c;
- clients->prev = c;
+ c->prev = clients->prev;
+ c->next = clients;
+ clients->prev->next = c;
+ clients->prev = c;
}
clients = c;
}
@@ -352,64 +354,64 @@ clientUpdateFocus (Client * c, unsigned short flags)
pending_focus = NULL;
if ((c) && !clientAcceptFocus (c))
{
- TRACE ("SKIP_FOCUS set for client \"%s\" (0x%lx)", c->name, c->window);
- return;
+ TRACE ("SKIP_FOCUS set for client \"%s\" (0x%lx)", c->name, c->window);
+ return;
}
if ((c == client_focus) && !(flags & FOCUS_FORCE))
{
- TRACE ("client \"%s\" (0x%lx) is already focused, ignoring request",
- c->name, c->window);
- return;
+ TRACE ("client \"%s\" (0x%lx) is already focused, ignoring request",
+ c->name, c->window);
+ return;
}
client_focus = c;
if (c)
{
- clientInstallColormaps (c);
- if (flags & FOCUS_SORT)
- {
- clientSortRing(c);
- }
- data[0] = c->window;
- if ((c->legacy_fullscreen) || FLAG_TEST(c->flags, CLIENT_FLAG_FULLSCREEN))
- {
- clientSetLayer (c, WIN_LAYER_ABOVE_DOCK);
- }
- frameDraw (c, FALSE, FALSE);
+ clientInstallColormaps (c);
+ if (flags & FOCUS_SORT)
+ {
+ clientSortRing(c);
+ }
+ data[0] = c->window;
+ if ((c->legacy_fullscreen) || FLAG_TEST(c->flags, CLIENT_FLAG_FULLSCREEN))
+ {
+ clientSetLayer (c, WIN_LAYER_ABOVE_DOCK);
+ }
+ frameDraw (c, FALSE, FALSE);
}
else
{
- data[0] = None;
+ data[0] = None;
}
if (c2)
{
- TRACE ("redrawing previous focus client \"%s\" (0x%lx)", c2->name,
- c2->window);
- /* Requires a bit of explanation here... Legacy apps automatically
- switch to above layer when receiving focus, and return to
- normal layer when loosing focus.
- The following "logic" is in charge of that behaviour.
- */
- if ((c2->legacy_fullscreen) || FLAG_TEST(c2->flags, CLIENT_FLAG_FULLSCREEN))
- {
- if (FLAG_TEST(c2->flags, CLIENT_FLAG_FULLSCREEN))
- {
- clientSetLayer (c2, c2->fullscreen_old_layer);
- }
- else
- {
- clientSetLayer (c2, WIN_LAYER_NORMAL);
- }
- if (c)
- {
- clientRaise(c);
- clientPassGrabButton1 (c);
- }
- }
- frameDraw (c2, FALSE, FALSE);
+ TRACE ("redrawing previous focus client \"%s\" (0x%lx)", c2->name,
+ c2->window);
+ /* Requires a bit of explanation here... Legacy apps automatically
+ switch to above layer when receiving focus, and return to
+ normal layer when loosing focus.
+ The following "logic" is in charge of that behaviour.
+ */
+ if ((c2->legacy_fullscreen) || FLAG_TEST(c2->flags, CLIENT_FLAG_FULLSCREEN))
+ {
+ if (FLAG_TEST(c2->flags, CLIENT_FLAG_FULLSCREEN))
+ {
+ clientSetLayer (c2, c2->fullscreen_old_layer);
+ }
+ else
+ {
+ clientSetLayer (c2, WIN_LAYER_NORMAL);
+ }
+ if (c)
+ {
+ clientRaise(c);
+ clientPassGrabButton1 (c);
+ }
+ }
+ frameDraw (c2, FALSE, FALSE);
}
data[1] = None;
- XChangeProperty (dpy, root, net_active_window, XA_WINDOW, 32,
- PropModeReplace, (unsigned char *) data, 2);
+ XChangeProperty (md->dpy, md->xroot, net_active_window, XA_WINDOW, 32,
+ PropModeReplace, (unsigned char *) data, 2);
}
void
@@ -421,55 +423,55 @@ clientSetFocus (Client * c, Time timestamp, unsigned short flags)
if ((c) && !(flags & FOCUS_IGNORE_MODAL))
{
- c2 = clientGetModalFor (c);
+ c2 = clientGetModalFor (c);
- if (c2)
- {
- c = c2;
- }
+ if (c2)
+ {
+ c = c2;
+ }
}
c2 = ((client_focus != c) ? client_focus : NULL);
if ((c) && FLAG_TEST (c->flags, CLIENT_FLAG_VISIBLE))
{
- TRACE ("setting focus to client \"%s\" (0x%lx)", c->name, c->window);
- if ((c == client_focus) && !(flags & FOCUS_FORCE))
- {
- TRACE ("client \"%s\" (0x%lx) is already focused, ignoring request",
- c->name, c->window);
- return;
- }
- if (!clientAcceptFocus (c))
- {
- TRACE ("SKIP_FOCUS set for client \"%s\" (0x%lx)", c->name, c->window);
- return;
- }
- if (FLAG_TEST (c->wm_flags, WM_FLAG_INPUT))
- {
- pending_focus = c;
- XSetInputFocus (dpy, c->window, RevertToPointerRoot, timestamp);
- }
- if (FLAG_TEST(c->wm_flags, WM_FLAG_TAKEFOCUS))
- {
- sendClientMessage (c->window, wm_protocols, wm_takefocus, timestamp);
- }
- XFlush (dpy);
+ TRACE ("setting focus to client \"%s\" (0x%lx)", c->name, c->window);
+ if ((c == client_focus) && !(flags & FOCUS_FORCE))
+ {
+ TRACE ("client \"%s\" (0x%lx) is already focused, ignoring request",
+ c->name, c->window);
+ return;
+ }
+ if (!clientAcceptFocus (c))
+ {
+ TRACE ("SKIP_FOCUS set for client \"%s\" (0x%lx)", c->name, c->window);
+ return;
+ }
+ if (FLAG_TEST (c->wm_flags, WM_FLAG_INPUT))
+ {
+ pending_focus = c;
+ XSetInputFocus (md->dpy, c->window, RevertToPointerRoot, timestamp);
+ }
+ if (FLAG_TEST(c->wm_flags, WM_FLAG_TAKEFOCUS))
+ {
+ sendClientMessage (c->window, wm_protocols, wm_takefocus, timestamp);
+ }
+ XFlush (md->dpy);
}
else
{
- unsigned long data[2];
-
- TRACE ("setting focus to none");
-
- client_focus = NULL;
- if (c2)
- {
- frameDraw (c2, FALSE, FALSE);
- }
- XSetInputFocus (dpy, gnome_win, RevertToPointerRoot, GDK_CURRENT_TIME);
- XFlush (dpy);
- data[0] = data[1] = None;
- XChangeProperty (dpy, root, net_active_window, XA_WINDOW, 32,
- PropModeReplace, (unsigned char *) data, 2);
+ unsigned long data[2];
+
+ TRACE ("setting focus to none");
+
+ client_focus = NULL;
+ if (c2)
+ {
+ frameDraw (c2, FALSE, FALSE);
+ }
+ XSetInputFocus (md->dpy, md->gnome_win, RevertToPointerRoot, GDK_CURRENT_TIME);
+ XFlush (md->dpy);
+ data[0] = data[1] = None;
+ XChangeProperty (md->dpy, md->xroot, net_active_window, XA_WINDOW, 32,
+ PropModeReplace, (unsigned char *) data, 2);
}
}
@@ -492,7 +494,7 @@ clientGrabButton1 (Client * c)
TRACE ("entering clientGrabButton1");
TRACE ("grabbing buttons for client \"%s\" (0x%lx)", c->name, c->window);
- grabButton(dpy, Button1, 0, c->window);
+ grabButton(md->dpy, Button1, 0, c->window);
}
void
@@ -502,7 +504,7 @@ clientUngrabButton1 (Client * c)
TRACE ("entering clientUngrabButton1");
TRACE ("ungrabing buttons for client \"%s\" (0x%lx)", c->name, c->window);
- ungrabButton(dpy, Button1, 0, c->window);
+ ungrabButton(md->dpy, Button1, 0, c->window);
}
void
@@ -513,22 +515,22 @@ clientPassGrabButton1(Client * c)
if (c == NULL)
{
- if (last_ungrab)
- {
- clientGrabButton1 (last_ungrab);
- }
- last_ungrab = NULL;
- return;
+ if (last_ungrab)
+ {
+ clientGrabButton1 (last_ungrab);
+ }
+ last_ungrab = NULL;
+ return;
}
if (last_ungrab == c)
{
- return;
+ return;
}
if (last_ungrab)
{
- clientGrabButton1 (last_ungrab);
+ clientGrabButton1 (last_ungrab);
}
clientUngrabButton1 (c);
diff --git a/src/focus.h b/src/focus.h
index e1ff49901..edf9162d4 100644
--- a/src/focus.h
+++ b/src/focus.h
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
@@ -34,14 +34,14 @@
#define FOCUS_FORCE (1<<2)
void clientFocusTop (int);
-void clientFocusNew(Client *);
-gboolean clientSelectMask (Client *, int);
-Client *clientGetNext (Client *, int);
+void clientFocusNew(Client *);
+gboolean clientSelectMask (Client *, int);
+Client *clientGetNext (Client *, int);
Client *clientGetPrevious (Client *, int);
-void clientPassFocus (Client *);
+void clientPassFocus (Client *);
gboolean clientAcceptFocus (Client *);
-void clientSortRing(Client *);
-void clientUpdateFocus (Client *, unsigned short);
+void clientSortRing(Client *);
+void clientUpdateFocus (Client *, unsigned short);
void clientSetFocus (Client *, Time, unsigned short);
void clientClearFocus (void);
Client *clientGetFocus (void);
diff --git a/src/frame.c b/src/frame.c
index f7378ddb9..cd65fe523 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -41,9 +41,9 @@ frameLeft (Client * c)
TRACE ("entering frameLeft");
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_FULLSCREEN))
{
- return params.sides[SIDE_LEFT][ACTIVE].width;
+ return params.sides[SIDE_LEFT][ACTIVE].width;
}
return 0;
}
@@ -54,9 +54,9 @@ frameRight (Client * c)
TRACE ("entering frameRight");
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_FULLSCREEN))
{
- return params.sides[SIDE_RIGHT][ACTIVE].width;
+ return params.sides[SIDE_RIGHT][ACTIVE].width;
}
return 0;
}
@@ -67,9 +67,9 @@ frameTop (Client * c)
TRACE ("entering frameTop");
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_FULLSCREEN))
{
- return params.title[TITLE_3][ACTIVE].height;
+ return params.title[TITLE_3][ACTIVE].height;
}
return 0;
}
@@ -80,9 +80,9 @@ frameBottom (Client * c)
TRACE ("entering frameBottom");
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_FULLSCREEN))
{
- return params.sides[SIDE_BOTTOM][ACTIVE].height;
+ return params.sides[SIDE_BOTTOM][ACTIVE].height;
}
return 0;
}
@@ -93,9 +93,9 @@ frameX (Client * c)
TRACE ("entering frameX");
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_FULLSCREEN))
{
- return c->x - frameLeft (c);
+ return c->x - frameLeft (c);
}
return c->x;
}
@@ -106,9 +106,9 @@ frameY (Client * c)
TRACE ("entering frameY");
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_FULLSCREEN))
{
- return c->y - frameTop (c);
+ return c->y - frameTop (c);
}
return c->y;
}
@@ -119,9 +119,9 @@ frameWidth (Client * c)
TRACE ("entering frameWidth");
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_FULLSCREEN))
{
- return c->width + frameLeft (c) + frameRight (c);
+ return c->width + frameLeft (c) + frameRight (c);
}
return c->width;
}
@@ -132,21 +132,21 @@ frameHeight (Client * c)
TRACE ("entering frameHeight");
if (FLAG_TEST_AND_NOT (c->flags,
- CLIENT_FLAG_HAS_BORDER | CLIENT_FLAG_SHADED,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_HAS_BORDER | CLIENT_FLAG_SHADED,
+ CLIENT_FLAG_FULLSCREEN))
{
- return frameTop (c) + frameBottom (c);
+ return frameTop (c) + frameBottom (c);
}
else if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
+ CLIENT_FLAG_FULLSCREEN))
{
- return c->height + frameTop (c) + frameBottom (c);
+ return c->height + frameTop (c) + frameBottom (c);
}
return c->height;
}
static void
-fillRectangle (Display * dpy, Drawable d, Pixmap pm, int x, int y, int width,
+fillRectangle (Display *dpy, Drawable d, Pixmap pm, int x, int y, int width,
int height)
{
XGCValues gv;
@@ -157,20 +157,20 @@ fillRectangle (Display * dpy, Drawable d, Pixmap pm, int x, int y, int width,
if ((width < 1) || (height < 1))
{
- return;
+ return;
}
gv.fill_style = FillTiled;
gv.tile = pm;
gv.ts_x_origin = x;
gv.ts_y_origin = y;
- gv.foreground = WhitePixel (dpy, screen);
+ gv.foreground = WhitePixel (dpy, md->screen);
if (gv.tile != None)
{
- mask = GCTile | GCFillStyle | GCTileStipXOrigin;
+ mask = GCTile | GCFillStyle | GCTileStipXOrigin;
}
else
{
- mask = GCForeground;
+ mask = GCForeground;
}
gc = XCreateGC (dpy, d, mask, &gv);
XFillRectangle (dpy, d, gc, x, y, width, height);
@@ -193,36 +193,36 @@ frameCreateTitlePixmap (Client * c, int state, int left, int right,
if (left > right)
{
- temp = left;
- left = right;
- right = temp;
+ temp = left;
+ left = right;
+ right = temp;
}
width =
- frameWidth (c) - params.corners[CORNER_TOP_LEFT][ACTIVE].width -
- params.corners[CORNER_TOP_RIGHT][ACTIVE].width;
+ frameWidth (c) - params.corners[CORNER_TOP_LEFT][ACTIVE].width -
+ params.corners[CORNER_TOP_RIGHT][ACTIVE].width;
if (width < 1)
{
- pm->pixmap = None;
- pm->mask = None;
- pm->width = 0;
- pm->height = 0;
- return;
+ pm->pixmap = None;
+ pm->mask = None;
+ pm->width = 0;
+ pm->height = 0;
+ return;
}
if (left < params.corners[CORNER_TOP_LEFT][ACTIVE].width)
{
- left = params.corners[CORNER_TOP_LEFT][ACTIVE].width;
+ left = params.corners[CORNER_TOP_LEFT][ACTIVE].width;
}
if (right >
- frameWidth (c) - params.corners[CORNER_TOP_RIGHT][ACTIVE].width)
+ frameWidth (c) - params.corners[CORNER_TOP_RIGHT][ACTIVE].width)
{
- right =
- frameWidth (c) - params.corners[CORNER_TOP_RIGHT][ACTIVE].width;
+ right =
+ frameWidth (c) - params.corners[CORNER_TOP_RIGHT][ACTIVE].width;
}
if (right < params.corners[CORNER_TOP_LEFT][ACTIVE].width)
{
- right = params.corners[CORNER_TOP_LEFT][ACTIVE].width;
+ right = params.corners[CORNER_TOP_LEFT][ACTIVE].width;
}
left = left - params.corners[CORNER_TOP_LEFT][ACTIVE].width;
@@ -231,130 +231,130 @@ frameCreateTitlePixmap (Client * c, int state, int left, int right,
w2 = params.title[TITLE_2][ACTIVE].width;
w4 = params.title[TITLE_4][ACTIVE].width;
- layout = gtk_widget_create_pango_layout (getDefaultGtkWidget (), c->name);
+ layout = gtk_widget_create_pango_layout (getDefaultGtkWidget (md->gtox_data), c->name);
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
if (params.full_width_title)
{
- w1 = left;
- w5 = width - right;
- w3 = width - w1 - w2 - w4 - w5;
- if (w3 < 0)
- {
- w3 = 0;
- }
- switch (params.title_alignment)
- {
- case ALIGN_LEFT:
- tp = params.title_horizontal_offset;
- break;
- case ALIGN_RIGHT:
- tp = w3 - logical_rect.width - params.title_horizontal_offset;
- break;
- case ALIGN_CENTER:
- tp = (w3 >> 1) - (logical_rect.width >> 1);
- break;
- }
- if (tp < params.title_horizontal_offset)
- {
- tp = params.title_horizontal_offset;
- }
+ w1 = left;
+ w5 = width - right;
+ w3 = width - w1 - w2 - w4 - w5;
+ if (w3 < 0)
+ {
+ w3 = 0;
+ }
+ switch (params.title_alignment)
+ {
+ case ALIGN_LEFT:
+ tp = params.title_horizontal_offset;
+ break;
+ case ALIGN_RIGHT:
+ tp = w3 - logical_rect.width - params.title_horizontal_offset;
+ break;
+ case ALIGN_CENTER:
+ tp = (w3 >> 1) - (logical_rect.width >> 1);
+ break;
+ }
+ if (tp < params.title_horizontal_offset)
+ {
+ tp = params.title_horizontal_offset;
+ }
}
else
{
- w3 = logical_rect.width;
- w5 = width;
- if (w3 > width - w2 - w4)
- {
- w3 = width - w2 - w4;
- }
- if (w3 < 0)
- {
- w3 = 0;
- }
- switch (params.title_alignment)
- {
- case ALIGN_LEFT:
- w1 = left + params.title_horizontal_offset;
- break;
- case ALIGN_RIGHT:
- w1 = right - w2 - w3 - w4 - params.title_horizontal_offset;
- break;
- case ALIGN_CENTER:
- w1 = left + ((right - left) / 2) - (w3 >> 1) - w2;
- break;
- }
- if (w1 < left)
- {
- w1 = left;
- }
- }
-
- myPixmapCreate (dpy, pm, width, frameTop (c));
+ w3 = logical_rect.width;
+ w5 = width;
+ if (w3 > width - w2 - w4)
+ {
+ w3 = width - w2 - w4;
+ }
+ if (w3 < 0)
+ {
+ w3 = 0;
+ }
+ switch (params.title_alignment)
+ {
+ case ALIGN_LEFT:
+ w1 = left + params.title_horizontal_offset;
+ break;
+ case ALIGN_RIGHT:
+ w1 = right - w2 - w3 - w4 - params.title_horizontal_offset;
+ break;
+ case ALIGN_CENTER:
+ w1 = left + ((right - left) / 2) - (w3 >> 1) - w2;
+ break;
+ }
+ if (w1 < left)
+ {
+ w1 = left;
+ }
+ }
+
+ myPixmapCreate (md->dpy, pm, width, frameTop (c));
gpixmap = gdk_pixmap_foreign_new (pm->pixmap);
gdk_drawable_set_colormap (gpixmap, gdk_colormap_get_system ());
gc = gdk_gc_new (gpixmap);
if (w1 > 0)
{
- fillRectangle (dpy, pm->pixmap, params.title[TITLE_1][state].pixmap,
- 0, 0, w1, frameTop (c));
- fillRectangle (dpy, pm->mask, params.title[TITLE_1][state].mask, 0, 0,
- w1, frameTop (c));
- x = x + w1;
+ fillRectangle (md->dpy, pm->pixmap, params.title[TITLE_1][state].pixmap,
+ 0, 0, w1, frameTop (c));
+ fillRectangle (md->dpy, pm->mask, params.title[TITLE_1][state].mask, 0, 0,
+ w1, frameTop (c));
+ x = x + w1;
}
- fillRectangle (dpy, pm->pixmap, params.title[TITLE_2][state].pixmap, x, 0,
- w2, frameTop (c));
- fillRectangle (dpy, pm->mask, params.title[TITLE_2][state].mask, x, 0, w2,
- frameTop (c));
+ fillRectangle (md->dpy, pm->pixmap, params.title[TITLE_2][state].pixmap, x, 0,
+ w2, frameTop (c));
+ fillRectangle (md->dpy, pm->mask, params.title[TITLE_2][state].mask, x, 0, w2,
+ frameTop (c));
x = x + w2;
if (w3 > 0)
{
- if (state == ACTIVE)
- {
- voffset = params.title_vertical_offset_active;
- }
- else
- {
- voffset = params.title_vertical_offset_inactive;
- }
- fillRectangle (dpy, pm->pixmap, params.title[TITLE_3][state].pixmap,
- x, 0, w3, frameTop (c));
- fillRectangle (dpy, pm->mask, params.title[TITLE_3][state].mask, x, 0,
- w3, frameTop (c));
- if (params.title_shadow[state])
- {
- gdk_gc_get_values (params.black_gc, &values);
- gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND);
- gdk_draw_layout (gpixmap, gc, x + tp + 1,
- (frameTop (c) + voffset - logical_rect.height) / 2 + 1,
- layout);
- }
- gdk_gc_get_values (params.title_colors[state].gc, &values);
- gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND);
- gdk_draw_layout (gpixmap, gc, x + tp,
- (frameTop (c) + voffset - logical_rect.height) / 2, layout);
- x = x + w3;
+ if (state == ACTIVE)
+ {
+ voffset = params.title_vertical_offset_active;
+ }
+ else
+ {
+ voffset = params.title_vertical_offset_inactive;
+ }
+ fillRectangle (md->dpy, pm->pixmap, params.title[TITLE_3][state].pixmap,
+ x, 0, w3, frameTop (c));
+ fillRectangle (md->dpy, pm->mask, params.title[TITLE_3][state].mask, x, 0,
+ w3, frameTop (c));
+ if (params.title_shadow[state])
+ {
+ gdk_gc_get_values (params.black_gc, &values);
+ gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND);
+ gdk_draw_layout (gpixmap, gc, x + tp + 1,
+ (frameTop (c) + voffset - logical_rect.height) / 2 + 1,
+ layout);
+ }
+ gdk_gc_get_values (params.title_colors[state].gc, &values);
+ gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND);
+ gdk_draw_layout (gpixmap, gc, x + tp,
+ (frameTop (c) + voffset - logical_rect.height) / 2, layout);
+ x = x + w3;
}
if (x > right - w4)
{
- x = right - w4;
+ x = right - w4;
}
- fillRectangle (dpy, pm->pixmap, params.title[TITLE_4][state].pixmap, x, 0,
- w4, frameTop (c));
- fillRectangle (dpy, pm->mask, params.title[TITLE_4][state].mask, x, 0, w4,
- frameTop (c));
+ fillRectangle (md->dpy, pm->pixmap, params.title[TITLE_4][state].pixmap, x, 0,
+ w4, frameTop (c));
+ fillRectangle (md->dpy, pm->mask, params.title[TITLE_4][state].mask, x, 0, w4,
+ frameTop (c));
x = x + w4;
if (w5 > 0)
{
- fillRectangle (dpy, pm->pixmap, params.title[TITLE_5][state].pixmap,
- x, 0, w5, frameTop (c));
- fillRectangle (dpy, pm->mask, params.title[TITLE_5][state].mask, x, 0,
- w5, frameTop (c));
+ fillRectangle (md->dpy, pm->pixmap, params.title[TITLE_5][state].pixmap,
+ x, 0, w5, frameTop (c));
+ fillRectangle (md->dpy, pm->mask, params.title[TITLE_5][state].mask, x, 0,
+ w5, frameTop (c));
}
g_object_unref (G_OBJECT (gc));
g_object_unref (G_OBJECT (gpixmap));
@@ -370,45 +370,45 @@ getButtonFromLetter (char chr, Client * c)
switch (chr)
{
- case 'H':
- if (CLIENT_CAN_HIDE_WINDOW (c))
- {
- b = HIDE_BUTTON;
- }
- break;
- case 'C':
- if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_CLOSE))
- {
- b = CLOSE_BUTTON;
- }
- break;
- case 'M':
- if (CLIENT_CAN_MAXIMIZE_WINDOW (c))
- {
- b = MAXIMIZE_BUTTON;
- }
- break;
- case 'S':
- b = SHADE_BUTTON;
- break;
- case 'T':
- if (FLAG_TEST_ALL (c->flags,
- CLIENT_FLAG_HAS_STICK | CLIENT_FLAG_HAS_MENU))
- {
- b = STICK_BUTTON;
- }
- break;
- case 'O':
- if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_MENU))
- {
- b = MENU_BUTTON;
- }
- break;
- case '|':
- b = TITLE_SEPARATOR;
- break;
- default:
- b = -1;
+ case 'H':
+ if (CLIENT_CAN_HIDE_WINDOW (c))
+ {
+ b = HIDE_BUTTON;
+ }
+ break;
+ case 'C':
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_CLOSE))
+ {
+ b = CLOSE_BUTTON;
+ }
+ break;
+ case 'M':
+ if (CLIENT_CAN_MAXIMIZE_WINDOW (c))
+ {
+ b = MAXIMIZE_BUTTON;
+ }
+ break;
+ case 'S':
+ b = SHADE_BUTTON;
+ break;
+ case 'T':
+ if (FLAG_TEST_ALL (c->flags,
+ CLIENT_FLAG_HAS_STICK | CLIENT_FLAG_HAS_MENU))
+ {
+ b = STICK_BUTTON;
+ }
+ break;
+ case 'O':
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_MENU))
+ {
+ b = MENU_BUTTON;
+ }
+ break;
+ case '|':
+ b = TITLE_SEPARATOR;
+ break;
+ default:
+ b = -1;
}
return b;
}
@@ -422,42 +422,42 @@ getLetterFromButton (int i, Client * c)
switch (i)
{
- case HIDE_BUTTON:
- if (CLIENT_CAN_HIDE_WINDOW (c))
- {
- chr = 'H';
- }
- break;
- case CLOSE_BUTTON:
- if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_CLOSE))
- {
- chr = 'C';
- }
- break;
- case MAXIMIZE_BUTTON:
- if (CLIENT_CAN_MAXIMIZE_WINDOW (c))
- {
- chr = 'M';
- }
- break;
- case SHADE_BUTTON:
- chr = 'S';
- break;
- case STICK_BUTTON:
- if (FLAG_TEST_ALL (c->flags,
- CLIENT_FLAG_HAS_STICK | CLIENT_FLAG_HAS_MENU))
- {
- chr = 'T';
- }
- break;
- case MENU_BUTTON:
- if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_MENU))
- {
- chr = 'O';
- }
- break;
- default:
- chr = 0;
+ case HIDE_BUTTON:
+ if (CLIENT_CAN_HIDE_WINDOW (c))
+ {
+ chr = 'H';
+ }
+ break;
+ case CLOSE_BUTTON:
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_CLOSE))
+ {
+ chr = 'C';
+ }
+ break;
+ case MAXIMIZE_BUTTON:
+ if (CLIENT_CAN_MAXIMIZE_WINDOW (c))
+ {
+ chr = 'M';
+ }
+ break;
+ case SHADE_BUTTON:
+ chr = 'S';
+ break;
+ case STICK_BUTTON:
+ if (FLAG_TEST_ALL (c->flags,
+ CLIENT_FLAG_HAS_STICK | CLIENT_FLAG_HAS_MENU))
+ {
+ chr = 'T';
+ }
+ break;
+ case MENU_BUTTON:
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_MENU))
+ {
+ chr = 'O';
+ }
+ break;
+ default:
+ chr = 0;
}
return chr;
}
@@ -467,32 +467,32 @@ frameGetPixmap (Client * c, int button, int state)
{
switch (button)
{
- case SHADE_BUTTON:
- if (FLAG_TEST (c->flags, CLIENT_FLAG_SHADED)
- && params.buttons[SHADE_BUTTON][state + 3].pixmap)
- {
- return &params.buttons[SHADE_BUTTON][state + 3];
- }
- return &params.buttons[SHADE_BUTTON][state];
- break;
- case STICK_BUTTON:
- if (FLAG_TEST (c->flags, CLIENT_FLAG_STICKY)
- && params.buttons[STICK_BUTTON][state + 3].pixmap)
- {
- return &params.buttons[STICK_BUTTON][state + 3];
- }
- return &params.buttons[STICK_BUTTON][state];
- break;
- case MAXIMIZE_BUTTON:
- if (FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED)
- && params.buttons[MAXIMIZE_BUTTON][state + 3].pixmap)
- {
- return &params.buttons[MAXIMIZE_BUTTON][state + 3];
- }
- return &params.buttons[MAXIMIZE_BUTTON][state];
- break;
- default:
- break;
+ case SHADE_BUTTON:
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_SHADED)
+ && params.buttons[SHADE_BUTTON][state + 3].pixmap)
+ {
+ return &params.buttons[SHADE_BUTTON][state + 3];
+ }
+ return &params.buttons[SHADE_BUTTON][state];
+ break;
+ case STICK_BUTTON:
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_STICKY)
+ && params.buttons[STICK_BUTTON][state + 3].pixmap)
+ {
+ return &params.buttons[STICK_BUTTON][state + 3];
+ }
+ return &params.buttons[STICK_BUTTON][state];
+ break;
+ case MAXIMIZE_BUTTON:
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED)
+ && params.buttons[MAXIMIZE_BUTTON][state + 3].pixmap)
+ {
+ return &params.buttons[MAXIMIZE_BUTTON][state + 3];
+ }
+ return &params.buttons[MAXIMIZE_BUTTON][state];
+ break;
+ default:
+ break;
}
return &params.buttons[button][state];
}
@@ -510,172 +510,172 @@ frameSetShape (Client * c, int state, ClientPixmapCache * pm_cache,
TRACE ("entering frameSetShape");
TRACE ("setting shape for client (0x%lx)", c->window);
- if (!shape)
+ if (!md->shape)
{
- return;
+ return;
}
temp =
- XCreateSimpleWindow (dpy, root, 0, 0, frameWidth (c), frameHeight (c),
- 0, 0, 0);
+ XCreateSimpleWindow (md->dpy, md->xroot, 0, 0, frameWidth (c), frameHeight (c),
+ 0, 0, 0);
if (FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
{
- rect.x = 0;
- rect.y = 0;
- rect.width = frameWidth (c);
- rect.height = frameHeight (c);
- XShapeCombineRectangles (dpy, temp, ShapeBounding, 0, 0, &rect, 1,
- ShapeSubtract, 0);
+ rect.x = 0;
+ rect.y = 0;
+ rect.width = frameWidth (c);
+ rect.height = frameHeight (c);
+ XShapeCombineRectangles (md->dpy, temp, ShapeBounding, 0, 0, &rect, 1,
+ ShapeSubtract, 0);
}
else
{
- XShapeCombineShape (dpy, temp, ShapeBounding, frameLeft (c),
- frameTop (c), c->window, ShapeBounding, ShapeSet);
+ XShapeCombineShape (md->dpy, temp, ShapeBounding, frameLeft (c),
+ frameTop (c), c->window, ShapeBounding, ShapeSet);
}
if (pm_cache)
{
- XShapeCombineMask (dpy, MYWINDOW_XWINDOW (c->title), ShapeBounding, 0,
- 0, pm_cache->pm_title[state].mask, ShapeSet);
- if (!FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
- {
- XShapeCombineMask (dpy, MYWINDOW_XWINDOW (c->sides[SIDE_LEFT]),
- ShapeBounding, 0, 0,
- pm_cache->pm_sides[SIDE_LEFT][state].mask, ShapeSet);
- XShapeCombineMask (dpy, MYWINDOW_XWINDOW (c->sides[SIDE_RIGHT]),
- ShapeBounding, 0, 0,
- pm_cache->pm_sides[SIDE_RIGHT][state].mask, ShapeSet);
- }
- XShapeCombineMask (dpy, MYWINDOW_XWINDOW (c->sides[SIDE_BOTTOM]),
- ShapeBounding, 0, 0, pm_cache->pm_sides[SIDE_BOTTOM][state].mask,
- ShapeSet);
- XShapeCombineMask (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]), ShapeBounding,
- 0, 0, params.corners[CORNER_BOTTOM_LEFT][state].mask, ShapeSet);
- XShapeCombineMask (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]), ShapeBounding,
- 0, 0, params.corners[CORNER_BOTTOM_RIGHT][state].mask, ShapeSet);
- XShapeCombineMask (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]), ShapeBounding, 0,
- 0, params.corners[CORNER_TOP_LEFT][state].mask, ShapeSet);
- XShapeCombineMask (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]), ShapeBounding, 0,
- 0, params.corners[CORNER_TOP_RIGHT][state].mask, ShapeSet);
-
- for (i = 0; i < BUTTON_COUNT; i++)
- {
- my_pixmap =
- frameGetPixmap (c, i, c->button_pressed[i] ? PRESSED : state);
- XShapeCombineMask (dpy, MYWINDOW_XWINDOW (c->buttons[i]),
- ShapeBounding, 0, 0, my_pixmap->mask, ShapeSet);
- }
-
- if (params.corners[CORNER_TOP_LEFT][ACTIVE].height >
- frameHeight (c) - frameBottom (c) + 1)
- {
- rect.x = 0;
- rect.y = frameHeight (c) - frameBottom (c) + 1;
- rect.width = params.corners[CORNER_TOP_LEFT][ACTIVE].width;
- rect.height =
- params.corners[CORNER_TOP_LEFT][ACTIVE].height -
- (frameHeight (c) - frameBottom (c) + 1);
- XShapeCombineRectangles (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]), ShapeBounding,
- 0, 0, &rect, 1, ShapeSubtract, 0);
- }
- if (params.corners[CORNER_TOP_RIGHT][ACTIVE].height >
- frameHeight (c) - frameBottom (c) + 1)
- {
- rect.x = 0;
- rect.y = frameHeight (c) - frameBottom (c) + 1;
- rect.width = params.corners[CORNER_TOP_RIGHT][ACTIVE].width;
- rect.height =
- params.corners[CORNER_TOP_RIGHT][ACTIVE].height -
- (frameHeight (c) - frameBottom (c) + 1);
- XShapeCombineRectangles (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]),
- ShapeBounding, 0, 0, &rect, 1, ShapeSubtract, 0);
- }
- if (params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height >
- frameHeight (c) - frameTop (c) + 1)
- {
- rect.x = 0;
- rect.y = 0;
- rect.width = params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width;
- rect.height =
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height -
- (frameHeight (c) - frameTop (c) + 1);
- XShapeCombineRectangles (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]),
- ShapeBounding, 0, 0, &rect, 1, ShapeSubtract, 0);
- }
- if (params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height >
- frameHeight (c) - frameTop (c) + 1)
- {
- rect.x = 0;
- rect.y = 0;
- rect.width = params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width;
- rect.height =
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height -
- (frameHeight (c) - frameTop (c) + 1);
- XShapeCombineRectangles (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]),
- ShapeBounding, 0, 0, &rect, 1, ShapeSubtract, 0);
- }
-
- if (!FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
- {
- XShapeCombineShape (dpy, temp, ShapeBounding, 0, frameTop (c),
- MYWINDOW_XWINDOW (c->sides[SIDE_LEFT]), ShapeBounding,
- ShapeUnion);
- XShapeCombineShape (dpy, temp, ShapeBounding,
- frameWidth (c) - frameRight (c), frameTop (c),
- MYWINDOW_XWINDOW (c->sides[SIDE_RIGHT]), ShapeBounding,
- ShapeUnion);
- }
- XShapeCombineShape (dpy, temp, ShapeBounding,
- params.corners[CORNER_TOP_LEFT][ACTIVE].width, 0,
- MYWINDOW_XWINDOW (c->title), ShapeBounding, ShapeUnion);
- XShapeCombineShape (dpy, temp, ShapeBounding,
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width,
- frameHeight (c) - frameBottom (c),
- MYWINDOW_XWINDOW (c->sides[SIDE_BOTTOM]), ShapeBounding,
- ShapeUnion);
- XShapeCombineShape (dpy, temp, ShapeBounding, 0,
- frameHeight (c) -
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height,
- MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]), ShapeBounding,
- ShapeUnion);
- XShapeCombineShape (dpy, temp, ShapeBounding,
- frameWidth (c) -
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width,
- frameHeight (c) -
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height,
- MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]), ShapeBounding,
- ShapeUnion);
- XShapeCombineShape (dpy, temp, ShapeBounding, 0, 0,
- MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]), ShapeBounding,
- ShapeUnion);
- XShapeCombineShape (dpy, temp, ShapeBounding,
- frameWidth (c) - params.corners[CORNER_TOP_RIGHT][ACTIVE].width,
- 0, MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]), ShapeBounding,
- ShapeUnion);
-
- for (i = 0; i < BUTTON_COUNT; i++)
- {
- char b = getLetterFromButton (i, c);
- if ((b) && strchr (params.button_layout, b))
- {
- XShapeCombineShape (dpy, temp, ShapeBounding, button_x[i],
- (frameTop (c) - params.buttons[i][ACTIVE].height) / 2,
- MYWINDOW_XWINDOW (c->buttons[i]), ShapeBounding,
- ShapeUnion);
- }
- }
- }
- XShapeCombineShape (dpy, c->frame, ShapeBounding, 0, 0, temp,
- ShapeBounding, ShapeSet);
- XDestroyWindow (dpy, temp);
+ XShapeCombineMask (md->dpy, MYWINDOW_XWINDOW (c->title), ShapeBounding, 0,
+ 0, pm_cache->pm_title[state].mask, ShapeSet);
+ if (!FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
+ {
+ XShapeCombineMask (md->dpy, MYWINDOW_XWINDOW (c->sides[SIDE_LEFT]),
+ ShapeBounding, 0, 0,
+ pm_cache->pm_sides[SIDE_LEFT][state].mask, ShapeSet);
+ XShapeCombineMask (md->dpy, MYWINDOW_XWINDOW (c->sides[SIDE_RIGHT]),
+ ShapeBounding, 0, 0,
+ pm_cache->pm_sides[SIDE_RIGHT][state].mask, ShapeSet);
+ }
+ XShapeCombineMask (md->dpy, MYWINDOW_XWINDOW (c->sides[SIDE_BOTTOM]),
+ ShapeBounding, 0, 0, pm_cache->pm_sides[SIDE_BOTTOM][state].mask,
+ ShapeSet);
+ XShapeCombineMask (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]), ShapeBounding,
+ 0, 0, params.corners[CORNER_BOTTOM_LEFT][state].mask, ShapeSet);
+ XShapeCombineMask (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]), ShapeBounding,
+ 0, 0, params.corners[CORNER_BOTTOM_RIGHT][state].mask, ShapeSet);
+ XShapeCombineMask (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]), ShapeBounding, 0,
+ 0, params.corners[CORNER_TOP_LEFT][state].mask, ShapeSet);
+ XShapeCombineMask (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]), ShapeBounding, 0,
+ 0, params.corners[CORNER_TOP_RIGHT][state].mask, ShapeSet);
+
+ for (i = 0; i < BUTTON_COUNT; i++)
+ {
+ my_pixmap =
+ frameGetPixmap (c, i, c->button_pressed[i] ? PRESSED : state);
+ XShapeCombineMask (md->dpy, MYWINDOW_XWINDOW (c->buttons[i]),
+ ShapeBounding, 0, 0, my_pixmap->mask, ShapeSet);
+ }
+
+ if (params.corners[CORNER_TOP_LEFT][ACTIVE].height >
+ frameHeight (c) - frameBottom (c) + 1)
+ {
+ rect.x = 0;
+ rect.y = frameHeight (c) - frameBottom (c) + 1;
+ rect.width = params.corners[CORNER_TOP_LEFT][ACTIVE].width;
+ rect.height =
+ params.corners[CORNER_TOP_LEFT][ACTIVE].height -
+ (frameHeight (c) - frameBottom (c) + 1);
+ XShapeCombineRectangles (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]), ShapeBounding,
+ 0, 0, &rect, 1, ShapeSubtract, 0);
+ }
+ if (params.corners[CORNER_TOP_RIGHT][ACTIVE].height >
+ frameHeight (c) - frameBottom (c) + 1)
+ {
+ rect.x = 0;
+ rect.y = frameHeight (c) - frameBottom (c) + 1;
+ rect.width = params.corners[CORNER_TOP_RIGHT][ACTIVE].width;
+ rect.height =
+ params.corners[CORNER_TOP_RIGHT][ACTIVE].height -
+ (frameHeight (c) - frameBottom (c) + 1);
+ XShapeCombineRectangles (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]),
+ ShapeBounding, 0, 0, &rect, 1, ShapeSubtract, 0);
+ }
+ if (params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height >
+ frameHeight (c) - frameTop (c) + 1)
+ {
+ rect.x = 0;
+ rect.y = 0;
+ rect.width = params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width;
+ rect.height =
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height -
+ (frameHeight (c) - frameTop (c) + 1);
+ XShapeCombineRectangles (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]),
+ ShapeBounding, 0, 0, &rect, 1, ShapeSubtract, 0);
+ }
+ if (params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height >
+ frameHeight (c) - frameTop (c) + 1)
+ {
+ rect.x = 0;
+ rect.y = 0;
+ rect.width = params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width;
+ rect.height =
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height -
+ (frameHeight (c) - frameTop (c) + 1);
+ XShapeCombineRectangles (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]),
+ ShapeBounding, 0, 0, &rect, 1, ShapeSubtract, 0);
+ }
+
+ if (!FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
+ {
+ XShapeCombineShape (md->dpy, temp, ShapeBounding, 0, frameTop (c),
+ MYWINDOW_XWINDOW (c->sides[SIDE_LEFT]), ShapeBounding,
+ ShapeUnion);
+ XShapeCombineShape (md->dpy, temp, ShapeBounding,
+ frameWidth (c) - frameRight (c), frameTop (c),
+ MYWINDOW_XWINDOW (c->sides[SIDE_RIGHT]), ShapeBounding,
+ ShapeUnion);
+ }
+ XShapeCombineShape (md->dpy, temp, ShapeBounding,
+ params.corners[CORNER_TOP_LEFT][ACTIVE].width, 0,
+ MYWINDOW_XWINDOW (c->title), ShapeBounding, ShapeUnion);
+ XShapeCombineShape (md->dpy, temp, ShapeBounding,
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width,
+ frameHeight (c) - frameBottom (c),
+ MYWINDOW_XWINDOW (c->sides[SIDE_BOTTOM]), ShapeBounding,
+ ShapeUnion);
+ XShapeCombineShape (md->dpy, temp, ShapeBounding, 0,
+ frameHeight (c) -
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height,
+ MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]), ShapeBounding,
+ ShapeUnion);
+ XShapeCombineShape (md->dpy, temp, ShapeBounding,
+ frameWidth (c) -
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width,
+ frameHeight (c) -
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height,
+ MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]), ShapeBounding,
+ ShapeUnion);
+ XShapeCombineShape (md->dpy, temp, ShapeBounding, 0, 0,
+ MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]), ShapeBounding,
+ ShapeUnion);
+ XShapeCombineShape (md->dpy, temp, ShapeBounding,
+ frameWidth (c) - params.corners[CORNER_TOP_RIGHT][ACTIVE].width,
+ 0, MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]), ShapeBounding,
+ ShapeUnion);
+
+ for (i = 0; i < BUTTON_COUNT; i++)
+ {
+ char b = getLetterFromButton (i, c);
+ if ((b) && strchr (params.button_layout, b))
+ {
+ XShapeCombineShape (md->dpy, temp, ShapeBounding, button_x[i],
+ (frameTop (c) - params.buttons[i][ACTIVE].height) / 2,
+ MYWINDOW_XWINDOW (c->buttons[i]), ShapeBounding,
+ ShapeUnion);
+ }
+ }
+ }
+ XShapeCombineShape (md->dpy, c->frame, ShapeBounding, 0, 0, temp,
+ ShapeBounding, ShapeSet);
+ XDestroyWindow (md->dpy, temp);
}
void
@@ -703,295 +703,295 @@ frameDraw (Client * c, gboolean invalidate_cache, gboolean force_shape_update)
if (c != clientGetFocus ())
{
- TRACE ("\"%s\" is not the active window", c->name);
- state = INACTIVE;
+ TRACE ("\"%s\" is not the active window", c->name);
+ state = INACTIVE;
}
if ((state == INACTIVE) && ((c->draw_active) || (c->first_map)))
{
- requires_clearing = TRUE;
- c->draw_active = FALSE;
+ requires_clearing = TRUE;
+ c->draw_active = FALSE;
}
else if ((state == ACTIVE) && (!(c->draw_active) || (c->first_map)))
{
- requires_clearing = TRUE;
- c->draw_active = TRUE;
+ requires_clearing = TRUE;
+ c->draw_active = TRUE;
}
/* Flag clearance */
if (c->first_map)
{
- c->first_map = FALSE;
+ c->first_map = FALSE;
}
if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_HAS_BORDER,
- CLIENT_FLAG_FULLSCREEN))
- {
- /* Cache mgmt */
- if (invalidate_cache)
- {
- clientClearPixmapCache (c);
- requires_clearing = TRUE;
- }
- else
- {
- if (c->pm_cache.previous_width != c->width)
- {
- myPixmapFree (dpy, &c->pm_cache.pm_title[ACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_title[INACTIVE]);
- myPixmapFree (dpy,
- &c->pm_cache.pm_sides[SIDE_BOTTOM][ACTIVE]);
- myPixmapFree (dpy,
- &c->pm_cache.pm_sides[SIDE_BOTTOM][INACTIVE]);
- c->pm_cache.previous_width = c->width;
- requires_clearing = TRUE;
- }
- if (c->pm_cache.previous_height != c->height)
- {
- myPixmapFree (dpy, &c->pm_cache.pm_sides[SIDE_LEFT][ACTIVE]);
- myPixmapFree (dpy,
- &c->pm_cache.pm_sides[SIDE_LEFT][INACTIVE]);
- myPixmapFree (dpy, &c->pm_cache.pm_sides[SIDE_RIGHT][ACTIVE]);
- myPixmapFree (dpy,
- &c->pm_cache.pm_sides[SIDE_RIGHT][INACTIVE]);
- c->pm_cache.previous_height = c->height;
- requires_clearing = TRUE;
- }
- }
-
- /* First, hide the buttons that we don't have... */
- for (i = 0; i < BUTTON_COUNT; i++)
- {
- char b = getLetterFromButton (i, c);
- if ((!b) || !strchr (params.button_layout, b))
- {
- myWindowHide (&c->buttons[i]);
- }
- }
-
- /* Then, show the ones that we do have on right... */
- x = frameLeft (c) + params.button_offset;
- for (i = 0; i < strlen (params.button_layout); i++)
- {
- button = getButtonFromLetter (params.button_layout[i], c);
- if (button == TITLE_SEPARATOR)
- {
- break;
- }
- else if (button >= 0)
- {
- my_pixmap =
- frameGetPixmap (c, button,
- c->button_pressed[button] ? PRESSED : state);
- if (my_pixmap->pixmap)
- {
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->buttons[button]),
- my_pixmap->pixmap);
- }
- myWindowShow (&c->buttons[button], x,
- (frameTop (c) -
- params.buttons[button][ACTIVE].height) / 2,
- params.buttons[button][ACTIVE].width,
- params.buttons[button][ACTIVE].height, TRUE);
- button_x[button] = x;
- x = x + params.buttons[button][ACTIVE].width +
- params.button_spacing;
- }
- }
- left = x - params.button_spacing;
-
- /* and those that we do have on left... */
- x = frameWidth (c) - frameRight (c) + params.button_spacing -
- params.button_offset;
- for (j = strlen (params.button_layout) - 1; j >= i; j--)
- {
- button = getButtonFromLetter (params.button_layout[j], c);
- if (button == TITLE_SEPARATOR)
- {
- break;
- }
- else if (button >= 0)
- {
- my_pixmap =
- frameGetPixmap (c, button,
- c->button_pressed[button] ? PRESSED : state);
- if (my_pixmap->pixmap)
- {
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->buttons[button]),
- my_pixmap->pixmap);
- }
- x = x - params.buttons[button][ACTIVE].width -
- params.button_spacing;
- myWindowShow (&c->buttons[button], x,
- (frameTop (c) -
- params.buttons[button][ACTIVE].height) / 2,
- params.buttons[button][ACTIVE].width,
- params.buttons[button][ACTIVE].height, TRUE);
- button_x[button] = x;
- }
- }
- right = x;
-
- top_width =
- frameWidth (c) - params.corners[CORNER_TOP_LEFT][ACTIVE].width -
- params.corners[CORNER_TOP_RIGHT][ACTIVE].width;
- bottom_width =
- frameWidth (c) -
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width -
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width;
- left_height =
- frameHeight (c) - frameTop (c) -
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height;
- right_height =
- frameHeight (c) - frameTop (c) -
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height;
-
- if (c->pm_cache.pm_title[state].pixmap == None)
- {
- frameCreateTitlePixmap (c, state, left, right,
- &c->pm_cache.pm_title[state]);
- requires_clearing = TRUE;
- }
-
- if (c->pm_cache.pm_sides[SIDE_LEFT][state].pixmap == None)
- {
- myPixmapCreate (dpy, &c->pm_cache.pm_sides[SIDE_LEFT][state],
- frameLeft (c), left_height);
- requires_clearing = TRUE;
- }
- fillRectangle (dpy, c->pm_cache.pm_sides[SIDE_LEFT][state].pixmap,
- params.sides[SIDE_LEFT][state].pixmap, 0, 0, frameLeft (c),
- left_height);
- fillRectangle (dpy, c->pm_cache.pm_sides[SIDE_LEFT][state].mask,
- params.sides[SIDE_LEFT][state].mask, 0, 0, frameLeft (c),
- left_height);
-
- if (c->pm_cache.pm_sides[SIDE_RIGHT][state].pixmap == None)
- {
- myPixmapCreate (dpy, &c->pm_cache.pm_sides[SIDE_RIGHT][state],
- frameRight (c), right_height);
- requires_clearing = TRUE;
- }
- fillRectangle (dpy, c->pm_cache.pm_sides[SIDE_RIGHT][state].pixmap,
- params.sides[SIDE_RIGHT][state].pixmap, 0, 0, frameRight (c),
- right_height);
- fillRectangle (dpy, c->pm_cache.pm_sides[SIDE_RIGHT][state].mask,
- params.sides[SIDE_RIGHT][state].mask, 0, 0, frameRight (c),
- right_height);
-
- if (c->pm_cache.pm_sides[SIDE_BOTTOM][state].pixmap == None)
- {
- myPixmapCreate (dpy, &c->pm_cache.pm_sides[SIDE_BOTTOM][state],
- bottom_width, frameBottom (c));
- requires_clearing = TRUE;
- }
- fillRectangle (dpy, c->pm_cache.pm_sides[SIDE_BOTTOM][state].pixmap,
- params.sides[SIDE_BOTTOM][state].pixmap, 0, 0, bottom_width,
- frameBottom (c));
- fillRectangle (dpy, c->pm_cache.pm_sides[SIDE_BOTTOM][state].mask,
- params.sides[SIDE_BOTTOM][state].mask, 0, 0, bottom_width,
- frameBottom (c));
-
- XSetWindowBackgroundPixmap (dpy, MYWINDOW_XWINDOW (c->title),
- c->pm_cache.pm_title[state].pixmap);
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->sides[SIDE_LEFT]),
- c->pm_cache.pm_sides[SIDE_LEFT][state].pixmap);
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->sides[SIDE_RIGHT]),
- c->pm_cache.pm_sides[SIDE_RIGHT][state].pixmap);
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->sides[SIDE_BOTTOM]),
- c->pm_cache.pm_sides[SIDE_BOTTOM][state].pixmap);
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]),
- params.corners[CORNER_TOP_LEFT][state].pixmap);
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]),
- params.corners[CORNER_TOP_RIGHT][state].pixmap);
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]),
- params.corners[CORNER_BOTTOM_LEFT][state].pixmap);
- XSetWindowBackgroundPixmap (dpy,
- MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]),
- params.corners[CORNER_BOTTOM_RIGHT][state].pixmap);
-
- if (FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
- {
- myWindowHide (&c->sides[SIDE_LEFT]);
- myWindowHide (&c->sides[SIDE_RIGHT]);
- }
- else
- {
- myWindowShow (&c->sides[SIDE_LEFT], 0, frameTop (c),
- frameLeft (c), left_height, requires_clearing);
- myWindowShow (&c->sides[SIDE_RIGHT],
- frameWidth (c) - frameRight (c), frameTop (c), frameRight (c),
- right_height, requires_clearing);
- }
-
- myWindowShow (&c->title,
- params.corners[CORNER_TOP_LEFT][ACTIVE].width, 0, top_width,
- frameTop (c), requires_clearing);
- myWindowShow (&c->sides[SIDE_BOTTOM],
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width,
- frameHeight (c) - frameBottom (c), bottom_width, frameBottom (c),
- requires_clearing);
-
- myWindowShow (&c->corners[CORNER_TOP_LEFT], 0, 0,
- params.corners[CORNER_TOP_LEFT][ACTIVE].width,
- params.corners[CORNER_TOP_LEFT][ACTIVE].height,
- requires_clearing);
- myWindowShow (&c->corners[CORNER_TOP_RIGHT],
- frameWidth (c) - params.corners[CORNER_TOP_RIGHT][ACTIVE].width,
- 0, params.corners[CORNER_TOP_RIGHT][ACTIVE].width,
- params.corners[CORNER_TOP_RIGHT][ACTIVE].height,
- requires_clearing);
- myWindowShow (&c->corners[CORNER_BOTTOM_LEFT], 0,
- frameHeight (c) -
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height,
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width,
- params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height,
- requires_clearing);
- myWindowShow (&c->corners[CORNER_BOTTOM_RIGHT],
- frameWidth (c) -
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width,
- frameHeight (c) -
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height,
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width,
- params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height,
- requires_clearing);
-
- if (requires_clearing | force_shape_update)
- {
- frameSetShape (c, state, &c->pm_cache, button_x);
- }
+ CLIENT_FLAG_FULLSCREEN))
+ {
+ /* Cache mgmt */
+ if (invalidate_cache)
+ {
+ clientClearPixmapCache (c);
+ requires_clearing = TRUE;
+ }
+ else
+ {
+ if (c->pm_cache.previous_width != c->width)
+ {
+ myPixmapFree (md->dpy, &c->pm_cache.pm_title[ACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_title[INACTIVE]);
+ myPixmapFree (md->dpy,
+ &c->pm_cache.pm_sides[SIDE_BOTTOM][ACTIVE]);
+ myPixmapFree (md->dpy,
+ &c->pm_cache.pm_sides[SIDE_BOTTOM][INACTIVE]);
+ c->pm_cache.previous_width = c->width;
+ requires_clearing = TRUE;
+ }
+ if (c->pm_cache.previous_height != c->height)
+ {
+ myPixmapFree (md->dpy, &c->pm_cache.pm_sides[SIDE_LEFT][ACTIVE]);
+ myPixmapFree (md->dpy,
+ &c->pm_cache.pm_sides[SIDE_LEFT][INACTIVE]);
+ myPixmapFree (md->dpy, &c->pm_cache.pm_sides[SIDE_RIGHT][ACTIVE]);
+ myPixmapFree (md->dpy,
+ &c->pm_cache.pm_sides[SIDE_RIGHT][INACTIVE]);
+ c->pm_cache.previous_height = c->height;
+ requires_clearing = TRUE;
+ }
+ }
+
+ /* First, hide the buttons that we don't have... */
+ for (i = 0; i < BUTTON_COUNT; i++)
+ {
+ char b = getLetterFromButton (i, c);
+ if ((!b) || !strchr (params.button_layout, b))
+ {
+ myWindowHide (&c->buttons[i]);
+ }
+ }
+
+ /* Then, show the ones that we do have on right... */
+ x = frameLeft (c) + params.button_offset;
+ for (i = 0; i < strlen (params.button_layout); i++)
+ {
+ button = getButtonFromLetter (params.button_layout[i], c);
+ if (button == TITLE_SEPARATOR)
+ {
+ break;
+ }
+ else if (button >= 0)
+ {
+ my_pixmap =
+ frameGetPixmap (c, button,
+ c->button_pressed[button] ? PRESSED : state);
+ if (my_pixmap->pixmap)
+ {
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->buttons[button]),
+ my_pixmap->pixmap);
+ }
+ myWindowShow (&c->buttons[button], x,
+ (frameTop (c) -
+ params.buttons[button][ACTIVE].height) / 2,
+ params.buttons[button][ACTIVE].width,
+ params.buttons[button][ACTIVE].height, TRUE);
+ button_x[button] = x;
+ x = x + params.buttons[button][ACTIVE].width +
+ params.button_spacing;
+ }
+ }
+ left = x - params.button_spacing;
+
+ /* and those that we do have on left... */
+ x = frameWidth (c) - frameRight (c) + params.button_spacing -
+ params.button_offset;
+ for (j = strlen (params.button_layout) - 1; j >= i; j--)
+ {
+ button = getButtonFromLetter (params.button_layout[j], c);
+ if (button == TITLE_SEPARATOR)
+ {
+ break;
+ }
+ else if (button >= 0)
+ {
+ my_pixmap =
+ frameGetPixmap (c, button,
+ c->button_pressed[button] ? PRESSED : state);
+ if (my_pixmap->pixmap)
+ {
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->buttons[button]),
+ my_pixmap->pixmap);
+ }
+ x = x - params.buttons[button][ACTIVE].width -
+ params.button_spacing;
+ myWindowShow (&c->buttons[button], x,
+ (frameTop (c) -
+ params.buttons[button][ACTIVE].height) / 2,
+ params.buttons[button][ACTIVE].width,
+ params.buttons[button][ACTIVE].height, TRUE);
+ button_x[button] = x;
+ }
+ }
+ right = x;
+
+ top_width =
+ frameWidth (c) - params.corners[CORNER_TOP_LEFT][ACTIVE].width -
+ params.corners[CORNER_TOP_RIGHT][ACTIVE].width;
+ bottom_width =
+ frameWidth (c) -
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width -
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width;
+ left_height =
+ frameHeight (c) - frameTop (c) -
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height;
+ right_height =
+ frameHeight (c) - frameTop (c) -
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height;
+
+ if (c->pm_cache.pm_title[state].pixmap == None)
+ {
+ frameCreateTitlePixmap (c, state, left, right,
+ &c->pm_cache.pm_title[state]);
+ requires_clearing = TRUE;
+ }
+
+ if (c->pm_cache.pm_sides[SIDE_LEFT][state].pixmap == None)
+ {
+ myPixmapCreate (md->dpy, &c->pm_cache.pm_sides[SIDE_LEFT][state],
+ frameLeft (c), left_height);
+ requires_clearing = TRUE;
+ }
+ fillRectangle (md->dpy, c->pm_cache.pm_sides[SIDE_LEFT][state].pixmap,
+ params.sides[SIDE_LEFT][state].pixmap, 0, 0, frameLeft (c),
+ left_height);
+ fillRectangle (md->dpy, c->pm_cache.pm_sides[SIDE_LEFT][state].mask,
+ params.sides[SIDE_LEFT][state].mask, 0, 0, frameLeft (c),
+ left_height);
+
+ if (c->pm_cache.pm_sides[SIDE_RIGHT][state].pixmap == None)
+ {
+ myPixmapCreate (md->dpy, &c->pm_cache.pm_sides[SIDE_RIGHT][state],
+ frameRight (c), right_height);
+ requires_clearing = TRUE;
+ }
+ fillRectangle (md->dpy, c->pm_cache.pm_sides[SIDE_RIGHT][state].pixmap,
+ params.sides[SIDE_RIGHT][state].pixmap, 0, 0, frameRight (c),
+ right_height);
+ fillRectangle (md->dpy, c->pm_cache.pm_sides[SIDE_RIGHT][state].mask,
+ params.sides[SIDE_RIGHT][state].mask, 0, 0, frameRight (c),
+ right_height);
+
+ if (c->pm_cache.pm_sides[SIDE_BOTTOM][state].pixmap == None)
+ {
+ myPixmapCreate (md->dpy, &c->pm_cache.pm_sides[SIDE_BOTTOM][state],
+ bottom_width, frameBottom (c));
+ requires_clearing = TRUE;
+ }
+ fillRectangle (md->dpy, c->pm_cache.pm_sides[SIDE_BOTTOM][state].pixmap,
+ params.sides[SIDE_BOTTOM][state].pixmap, 0, 0, bottom_width,
+ frameBottom (c));
+ fillRectangle (md->dpy, c->pm_cache.pm_sides[SIDE_BOTTOM][state].mask,
+ params.sides[SIDE_BOTTOM][state].mask, 0, 0, bottom_width,
+ frameBottom (c));
+
+ XSetWindowBackgroundPixmap (md->dpy, MYWINDOW_XWINDOW (c->title),
+ c->pm_cache.pm_title[state].pixmap);
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->sides[SIDE_LEFT]),
+ c->pm_cache.pm_sides[SIDE_LEFT][state].pixmap);
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->sides[SIDE_RIGHT]),
+ c->pm_cache.pm_sides[SIDE_RIGHT][state].pixmap);
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->sides[SIDE_BOTTOM]),
+ c->pm_cache.pm_sides[SIDE_BOTTOM][state].pixmap);
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]),
+ params.corners[CORNER_TOP_LEFT][state].pixmap);
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]),
+ params.corners[CORNER_TOP_RIGHT][state].pixmap);
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]),
+ params.corners[CORNER_BOTTOM_LEFT][state].pixmap);
+ XSetWindowBackgroundPixmap (md->dpy,
+ MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]),
+ params.corners[CORNER_BOTTOM_RIGHT][state].pixmap);
+
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
+ {
+ myWindowHide (&c->sides[SIDE_LEFT]);
+ myWindowHide (&c->sides[SIDE_RIGHT]);
+ }
+ else
+ {
+ myWindowShow (&c->sides[SIDE_LEFT], 0, frameTop (c),
+ frameLeft (c), left_height, requires_clearing);
+ myWindowShow (&c->sides[SIDE_RIGHT],
+ frameWidth (c) - frameRight (c), frameTop (c), frameRight (c),
+ right_height, requires_clearing);
+ }
+
+ myWindowShow (&c->title,
+ params.corners[CORNER_TOP_LEFT][ACTIVE].width, 0, top_width,
+ frameTop (c), requires_clearing);
+ myWindowShow (&c->sides[SIDE_BOTTOM],
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width,
+ frameHeight (c) - frameBottom (c), bottom_width, frameBottom (c),
+ requires_clearing);
+
+ myWindowShow (&c->corners[CORNER_TOP_LEFT], 0, 0,
+ params.corners[CORNER_TOP_LEFT][ACTIVE].width,
+ params.corners[CORNER_TOP_LEFT][ACTIVE].height,
+ requires_clearing);
+ myWindowShow (&c->corners[CORNER_TOP_RIGHT],
+ frameWidth (c) - params.corners[CORNER_TOP_RIGHT][ACTIVE].width,
+ 0, params.corners[CORNER_TOP_RIGHT][ACTIVE].width,
+ params.corners[CORNER_TOP_RIGHT][ACTIVE].height,
+ requires_clearing);
+ myWindowShow (&c->corners[CORNER_BOTTOM_LEFT], 0,
+ frameHeight (c) -
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height,
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].width,
+ params.corners[CORNER_BOTTOM_LEFT][ACTIVE].height,
+ requires_clearing);
+ myWindowShow (&c->corners[CORNER_BOTTOM_RIGHT],
+ frameWidth (c) -
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width,
+ frameHeight (c) -
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height,
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].width,
+ params.corners[CORNER_BOTTOM_RIGHT][ACTIVE].height,
+ requires_clearing);
+
+ if (requires_clearing | force_shape_update)
+ {
+ frameSetShape (c, state, &c->pm_cache, button_x);
+ }
}
else
{
- myWindowHide (&c->title);
- for (i = 0; i < 3; i++)
- {
- if (MYWINDOW_XWINDOW (c->sides[i]))
- {
- myWindowHide (&c->sides[i]);
- }
- }
- for (i = 0; i < 4; i++)
- {
- if (MYWINDOW_XWINDOW (c->corners[i]))
- {
- myWindowHide (&c->corners[i]);
- }
- }
- for (i = 0; i < BUTTON_COUNT; i++)
- {
- if (MYWINDOW_XWINDOW (c->buttons[i]))
- {
- myWindowHide (&c->buttons[i]);
- }
- }
- frameSetShape (c, 0, NULL, 0);
+ myWindowHide (&c->title);
+ for (i = 0; i < 3; i++)
+ {
+ if (MYWINDOW_XWINDOW (c->sides[i]))
+ {
+ myWindowHide (&c->sides[i]);
+ }
+ }
+ for (i = 0; i < 4; i++)
+ {
+ if (MYWINDOW_XWINDOW (c->corners[i]))
+ {
+ myWindowHide (&c->corners[i]);
+ }
+ }
+ for (i = 0; i < BUTTON_COUNT; i++)
+ {
+ if (MYWINDOW_XWINDOW (c->buttons[i]))
+ {
+ myWindowHide (&c->buttons[i]);
+ }
+ }
+ frameSetShape (c, 0, NULL, 0);
}
}
diff --git a/src/frame.h b/src/frame.h
index 7a64a62f9..aa5579095 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
diff --git a/src/hints.c b/src/hints.c
index 75972cf6c..9ce24cce3 100644
--- a/src/hints.c
+++ b/src/hints.c
@@ -35,8 +35,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <libxfce4util/libxfce4util.h>
-#include "main.h"
#include "hints.h"
+#include "client.h"
Atom gnome_panel_desktop_area;
Atom motif_wm_hints;
@@ -401,8 +401,7 @@ setGnomeProtocols (Display * dpy, int screen, Window w)
XChangeProperty (dpy, RootWindow (dpy, screen), win_protocols, XA_ATOM,
32, PropModeReplace, (unsigned char *) atoms, 1);
setHint (dpy, w, win_supporting_wm_check, w);
- setHint (dpy, RootWindow (dpy, screen), win_supporting_wm_check,
- gnome_win);
+ setHint (dpy, RootWindow (dpy, screen), win_supporting_wm_check, w);
}
void
@@ -629,7 +628,7 @@ getCardinalList (Display * dpy, Window w, Atom xatom,
}
void
-setNetWorkarea (Display * dpy, int screen, int nb_workspaces, int * m)
+setNetWorkarea (Display * dpy, int screen, int nb_workspaces, int width, int height, int * m)
{
unsigned long *data, *ptr;
int i, j;
@@ -642,12 +641,8 @@ setNetWorkarea (Display * dpy, int screen, int nb_workspaces, int * m)
{
*ptr++ = (unsigned long) m[LEFT];
*ptr++ = (unsigned long) m[TOP];
- *ptr++ = (unsigned long)
- (gdk_screen_get_width (gscr) -
- (m[LEFT] + m[RIGHT]));
- *ptr++ = (unsigned long)
- (gdk_screen_get_height (gscr) -
- (m[TOP] + m[BOTTOM]));
+ *ptr++ = (unsigned long) (width - (m[LEFT] + m[RIGHT]));
+ *ptr++ = (unsigned long) (height - (m[TOP] + m[BOTTOM]));
}
XChangeProperty (dpy, RootWindow (dpy, screen), net_workarea, XA_CARDINAL,
32, PropModeReplace, (unsigned char *) data, j * 4);
@@ -655,12 +650,12 @@ setNetWorkarea (Display * dpy, int screen, int nb_workspaces, int * m)
}
void
-initNetDesktopParams (Display * dpy, int screen, int workspace)
+initNetDesktopParams (Display * dpy, int screen, int workspace, int width, int height)
{
unsigned long data[2];
TRACE ("entering initNetDesktopParams");
- data[0] = gdk_screen_get_width (gscr);
- data[1] = gdk_screen_get_height (gscr);
+ data[0] = width;
+ data[1] = height;
XChangeProperty (dpy, RootWindow (dpy, screen), net_desktop_geometry,
XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 2);
data[0] = 0;
diff --git a/src/hints.h b/src/hints.h
index 5ad466fc0..6ea5c0723 100644
--- a/src/hints.h
+++ b/src/hints.h
@@ -1,21 +1,21 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- Metacity - (c) 2001 Havoc Pennington
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ Metacity - (c) 2001 Havoc Pennington
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -31,6 +31,7 @@
#include <X11/Xmd.h>
#include <X11/Xatom.h>
#include <glib.h>
+#include <gdk/gdk.h>
#define MWM_HINTS_ELEMENTS 3L
@@ -207,8 +208,8 @@ void initNetHints (Display * dpy);
void setNetSupportedHint (Display *, int, Window);
gboolean getAtomList (Display *, Window, Atom, Atom **, int *);
gboolean getCardinalList (Display *, Window, Atom, unsigned long **, int *);
-void setNetWorkarea (Display *, int, int, int *);
-void initNetDesktopParams (Display *, int, int);
+void setNetWorkarea (Display *, int, int, int, int, int *);
+void initNetDesktopParams (Display *, int, int, int, int);
void set_utf8_string_hint (Display *, Window, Atom, const char *);
void getTransientFor (Display *, int, Window, Window *);
void getWindowName (Display *, Window, char **);
diff --git a/src/keyboard.c b/src/keyboard.c
index 02a09b88d..862ac7f42 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -58,48 +58,48 @@ parseKeyString (Display * dpy, MyKey * key, char *str)
if (!g_ascii_strcasecmp (str, "none"))
{
- return;
+ return;
}
k = strrchr (str, '+');
if (k)
{
- /* There is a modifier */
- gchar *tmp;
-
- tmp = g_ascii_strdown ((gchar *) str, -1);
-
- key->keycode = XKeysymToKeycode (dpy, XStringToKeysym (++k));
- if (strstr (tmp, "shift"))
- {
- key->modifier = key->modifier | ShiftMask;
- }
- if (strstr (tmp, "control"))
- {
- key->modifier = key->modifier | ControlMask;
- }
- if (strstr (tmp, "alt") || strstr (tmp, "mod1"))
- {
- key->modifier = key->modifier | AltMask;
- }
- if (strstr (tmp, "meta") || strstr (tmp, "mod2"))
- {
- key->modifier = key->modifier | MetaMask;
- }
- if (strstr (tmp, "hyper"))
- {
- key->modifier = key->modifier | HyperMask;
- }
- if (strstr (tmp, "super"))
- {
- key->modifier = key->modifier | SuperMask;
- }
- g_free (tmp);
+ /* There is a modifier */
+ gchar *tmp;
+
+ tmp = g_ascii_strdown ((gchar *) str, -1);
+
+ key->keycode = XKeysymToKeycode (dpy, XStringToKeysym (++k));
+ if (strstr (tmp, "shift"))
+ {
+ key->modifier = key->modifier | ShiftMask;
+ }
+ if (strstr (tmp, "control"))
+ {
+ key->modifier = key->modifier | ControlMask;
+ }
+ if (strstr (tmp, "alt") || strstr (tmp, "mod1"))
+ {
+ key->modifier = key->modifier | AltMask;
+ }
+ if (strstr (tmp, "meta") || strstr (tmp, "mod2"))
+ {
+ key->modifier = key->modifier | MetaMask;
+ }
+ if (strstr (tmp, "hyper"))
+ {
+ key->modifier = key->modifier | HyperMask;
+ }
+ if (strstr (tmp, "super"))
+ {
+ key->modifier = key->modifier | SuperMask;
+ }
+ g_free (tmp);
}
else
{
- key->keycode = XKeysymToKeycode (dpy, XStringToKeysym (str));
- key->modifier = 0;
+ key->keycode = XKeysymToKeycode (dpy, XStringToKeysym (str));
+ key->modifier = 0;
}
}
@@ -110,35 +110,35 @@ grabKey (Display * dpy, MyKey * key, Window w)
if (key->keycode)
{
- if (key->modifier == 0)
- {
- XGrabKey (dpy, key->keycode, AnyModifier, w, FALSE,
- GrabModeAsync, GrabModeAsync);
- }
- else
- {
- /* Here we grab all combinations of well known modifiers */
- XGrabKey (dpy, key->keycode, key->modifier, w, FALSE,
- GrabModeAsync, GrabModeAsync);
- XGrabKey (dpy, key->keycode, key->modifier | ScrollLockMask, w,
- FALSE, GrabModeAsync, GrabModeAsync);
- XGrabKey (dpy, key->keycode, key->modifier | NumLockMask, w,
- FALSE, GrabModeAsync, GrabModeAsync);
- XGrabKey (dpy, key->keycode, key->modifier | CapsLockMask, w,
- FALSE, GrabModeAsync, GrabModeAsync);
- XGrabKey (dpy, key->keycode,
- key->modifier | ScrollLockMask | NumLockMask, w, FALSE,
- GrabModeAsync, GrabModeAsync);
- XGrabKey (dpy, key->keycode,
- key->modifier | ScrollLockMask | CapsLockMask, w, FALSE,
- GrabModeAsync, GrabModeAsync);
- XGrabKey (dpy, key->keycode,
- key->modifier | CapsLockMask | NumLockMask, w, FALSE,
- GrabModeAsync, GrabModeAsync);
- XGrabKey (dpy, key->keycode,
- key->modifier | ScrollLockMask | CapsLockMask | NumLockMask,
- w, FALSE, GrabModeAsync, GrabModeAsync);
- }
+ if (key->modifier == 0)
+ {
+ XGrabKey (dpy, key->keycode, AnyModifier, w, FALSE,
+ GrabModeAsync, GrabModeAsync);
+ }
+ else
+ {
+ /* Here we grab all combinations of well known modifiers */
+ XGrabKey (dpy, key->keycode, key->modifier, w, FALSE,
+ GrabModeAsync, GrabModeAsync);
+ XGrabKey (dpy, key->keycode, key->modifier | ScrollLockMask, w,
+ FALSE, GrabModeAsync, GrabModeAsync);
+ XGrabKey (dpy, key->keycode, key->modifier | NumLockMask, w,
+ FALSE, GrabModeAsync, GrabModeAsync);
+ XGrabKey (dpy, key->keycode, key->modifier | CapsLockMask, w,
+ FALSE, GrabModeAsync, GrabModeAsync);
+ XGrabKey (dpy, key->keycode,
+ key->modifier | ScrollLockMask | NumLockMask, w, FALSE,
+ GrabModeAsync, GrabModeAsync);
+ XGrabKey (dpy, key->keycode,
+ key->modifier | ScrollLockMask | CapsLockMask, w, FALSE,
+ GrabModeAsync, GrabModeAsync);
+ XGrabKey (dpy, key->keycode,
+ key->modifier | CapsLockMask | NumLockMask, w, FALSE,
+ GrabModeAsync, GrabModeAsync);
+ XGrabKey (dpy, key->keycode,
+ key->modifier | ScrollLockMask | CapsLockMask | NumLockMask,
+ w, FALSE, GrabModeAsync, GrabModeAsync);
+ }
}
}
@@ -157,45 +157,45 @@ grabButton (Display * dpy, int button, int modifier, Window w)
if (modifier == AnyModifier)
{
- XGrabButton (dpy, button, AnyModifier, w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
+ XGrabButton (dpy, button, AnyModifier, w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
}
else
{
- /* Here we grab all combinations of well known modifiers */
- XGrabButton (dpy, button, modifier,
- w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
- XGrabButton (dpy, button, modifier | ScrollLockMask,
- w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
- XGrabButton (dpy, button, modifier | NumLockMask,
- w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
- XGrabButton (dpy, button, modifier | CapsLockMask, w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
- XGrabButton (dpy, button, modifier | ScrollLockMask | NumLockMask,
- w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
- XGrabButton (dpy, button, modifier | ScrollLockMask | CapsLockMask,
- w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
- XGrabButton (dpy, button, modifier | CapsLockMask | NumLockMask,
- w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
- XGrabButton (dpy, button,
- modifier | ScrollLockMask | CapsLockMask | NumLockMask,
- w, FALSE,
- ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
- None, None);
+ /* Here we grab all combinations of well known modifiers */
+ XGrabButton (dpy, button, modifier,
+ w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
+ XGrabButton (dpy, button, modifier | ScrollLockMask,
+ w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
+ XGrabButton (dpy, button, modifier | NumLockMask,
+ w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
+ XGrabButton (dpy, button, modifier | CapsLockMask, w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
+ XGrabButton (dpy, button, modifier | ScrollLockMask | NumLockMask,
+ w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
+ XGrabButton (dpy, button, modifier | ScrollLockMask | CapsLockMask,
+ w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
+ XGrabButton (dpy, button, modifier | CapsLockMask | NumLockMask,
+ w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
+ XGrabButton (dpy, button,
+ modifier | ScrollLockMask | CapsLockMask | NumLockMask,
+ w, FALSE,
+ ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync,
+ None, None);
}
}
@@ -208,19 +208,19 @@ ungrabButton (Display * dpy, int button, int modifier, Window w)
if (modifier == AnyModifier)
{
- XUngrabButton (dpy, button, AnyModifier, w);
+ XUngrabButton (dpy, button, AnyModifier, w);
}
else
{
- /* Here we ungrab all combinations of well known modifiers */
- XUngrabButton (dpy, button, modifier, w);
- XUngrabButton (dpy, button, modifier | ScrollLockMask, w);
- XUngrabButton (dpy, button, modifier | NumLockMask, w);
- XUngrabButton (dpy, button, modifier | CapsLockMask, w);
- XUngrabButton (dpy, button, modifier | ScrollLockMask | NumLockMask, w);
- XUngrabButton (dpy, button, modifier | ScrollLockMask | CapsLockMask, w);
- XUngrabButton (dpy, button, modifier | CapsLockMask | NumLockMask, w);
- XUngrabButton (dpy, button, modifier | ScrollLockMask | CapsLockMask | NumLockMask, w);
+ /* Here we ungrab all combinations of well known modifiers */
+ XUngrabButton (dpy, button, modifier, w);
+ XUngrabButton (dpy, button, modifier | ScrollLockMask, w);
+ XUngrabButton (dpy, button, modifier | NumLockMask, w);
+ XUngrabButton (dpy, button, modifier | CapsLockMask, w);
+ XUngrabButton (dpy, button, modifier | ScrollLockMask | NumLockMask, w);
+ XUngrabButton (dpy, button, modifier | ScrollLockMask | CapsLockMask, w);
+ XUngrabButton (dpy, button, modifier | CapsLockMask | NumLockMask, w);
+ XUngrabButton (dpy, button, modifier | ScrollLockMask | CapsLockMask | NumLockMask, w);
}
}
@@ -231,116 +231,116 @@ initModifiers (Display * dpy)
int m, k;
AltMask = MetaMask = NumLockMask = ScrollLockMask = CapsLockMask =
- SuperMask = HyperMask = 0;
+ SuperMask = HyperMask = 0;
if (xmk)
{
- KeyCode *c = xmk->modifiermap;
- KeyCode numLockKeyCode;
- KeyCode scrollLockKeyCode;
- KeyCode capsLockKeyCode;
- KeyCode altKeyCode;
- KeyCode metaKeyCode;
- KeyCode superKeyCode;
- KeyCode hyperKeyCode;
-
- numLockKeyCode = XKeysymToKeycode (dpy, XK_Num_Lock);
- scrollLockKeyCode = XKeysymToKeycode (dpy, XK_Scroll_Lock);
- capsLockKeyCode = XKeysymToKeycode (dpy, XK_Caps_Lock);
- altKeyCode = XKeysymToKeycode (dpy, XK_Alt_L);
- metaKeyCode = XKeysymToKeycode (dpy, XK_Meta_L);
- superKeyCode = XKeysymToKeycode (dpy, XK_Super_L);
- hyperKeyCode = XKeysymToKeycode (dpy, XK_Hyper_L);
-
- if (!altKeyCode)
- {
- altKeyCode = XKeysymToKeycode (dpy, XK_Alt_R);
- }
- if (!metaKeyCode)
- {
- metaKeyCode = XKeysymToKeycode (dpy, XK_Meta_R);
- }
- if (!superKeyCode)
- {
- superKeyCode = XKeysymToKeycode (dpy, XK_Super_R);
- }
- if (!hyperKeyCode)
- {
- hyperKeyCode = XKeysymToKeycode (dpy, XK_Hyper_R);
- }
-
-
- for (m = 0; m < 8; m++)
- {
- for (k = 0; k < xmk->max_keypermod; k++, c++)
- {
- if (*c == NoSymbol)
- {
- continue;
- }
- if (*c == numLockKeyCode)
- {
- NumLockMask = (1 << m);
- }
- if (*c == scrollLockKeyCode)
- {
- ScrollLockMask = (1 << m);
- }
- if (*c == capsLockKeyCode)
- {
- CapsLockMask = (1 << m);
- }
- if (*c == altKeyCode)
- {
- AltMask = (1 << m);
- }
- if (*c == metaKeyCode)
- {
- MetaMask = (1 << m);
- }
- if (*c == superKeyCode)
- {
- SuperMask = (1 << m);
- }
- if (*c == hyperKeyCode)
- {
- HyperMask = (1 << m);
- }
- }
- }
- XFreeModifiermap (xmk);
+ KeyCode *c = xmk->modifiermap;
+ KeyCode numLockKeyCode;
+ KeyCode scrollLockKeyCode;
+ KeyCode capsLockKeyCode;
+ KeyCode altKeyCode;
+ KeyCode metaKeyCode;
+ KeyCode superKeyCode;
+ KeyCode hyperKeyCode;
+
+ numLockKeyCode = XKeysymToKeycode (dpy, XK_Num_Lock);
+ scrollLockKeyCode = XKeysymToKeycode (dpy, XK_Scroll_Lock);
+ capsLockKeyCode = XKeysymToKeycode (dpy, XK_Caps_Lock);
+ altKeyCode = XKeysymToKeycode (dpy, XK_Alt_L);
+ metaKeyCode = XKeysymToKeycode (dpy, XK_Meta_L);
+ superKeyCode = XKeysymToKeycode (dpy, XK_Super_L);
+ hyperKeyCode = XKeysymToKeycode (dpy, XK_Hyper_L);
+
+ if (!altKeyCode)
+ {
+ altKeyCode = XKeysymToKeycode (dpy, XK_Alt_R);
+ }
+ if (!metaKeyCode)
+ {
+ metaKeyCode = XKeysymToKeycode (dpy, XK_Meta_R);
+ }
+ if (!superKeyCode)
+ {
+ superKeyCode = XKeysymToKeycode (dpy, XK_Super_R);
+ }
+ if (!hyperKeyCode)
+ {
+ hyperKeyCode = XKeysymToKeycode (dpy, XK_Hyper_R);
+ }
+
+
+ for (m = 0; m < 8; m++)
+ {
+ for (k = 0; k < xmk->max_keypermod; k++, c++)
+ {
+ if (*c == NoSymbol)
+ {
+ continue;
+ }
+ if (*c == numLockKeyCode)
+ {
+ NumLockMask = (1 << m);
+ }
+ if (*c == scrollLockKeyCode)
+ {
+ ScrollLockMask = (1 << m);
+ }
+ if (*c == capsLockKeyCode)
+ {
+ CapsLockMask = (1 << m);
+ }
+ if (*c == altKeyCode)
+ {
+ AltMask = (1 << m);
+ }
+ if (*c == metaKeyCode)
+ {
+ MetaMask = (1 << m);
+ }
+ if (*c == superKeyCode)
+ {
+ SuperMask = (1 << m);
+ }
+ if (*c == hyperKeyCode)
+ {
+ HyperMask = (1 << m);
+ }
+ }
+ }
+ XFreeModifiermap (xmk);
}
if (MetaMask == AltMask)
{
- MetaMask = 0;
+ MetaMask = 0;
}
if ((AltMask != 0) && (MetaMask == Mod1Mask))
{
- MetaMask = AltMask;
- AltMask = Mod1Mask;
+ MetaMask = AltMask;
+ AltMask = Mod1Mask;
}
if ((AltMask == 0) && (MetaMask != 0))
{
- if (MetaMask != Mod1Mask)
- {
- AltMask = Mod1Mask;
- }
- else
- {
- AltMask = MetaMask;
- MetaMask = 0;
- }
+ if (MetaMask != Mod1Mask)
+ {
+ AltMask = Mod1Mask;
+ }
+ else
+ {
+ AltMask = MetaMask;
+ MetaMask = 0;
+ }
}
if (AltMask == 0)
{
- AltMask = Mod1Mask;
+ AltMask = Mod1Mask;
}
KeyMask =
- ControlMask | ShiftMask | AltMask | MetaMask | SuperMask | HyperMask;
+ ControlMask | ShiftMask | AltMask | MetaMask | SuperMask | HyperMask;
ButtonMask =
- Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask;
+ Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask;
ButtonKeyMask = KeyMask | ButtonMask;
}
diff --git a/src/keyboard.h b/src/keyboard.h
index 2d3efcca2..5d4b0d75d 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
diff --git a/src/main.c b/src/main.c
index 560dfa25b..81eb1e2de 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,22 +64,7 @@
PropertyChangeMask|\
ColormapNotify
-char *progname;
-Display *dpy;
-GdkScreen *gscr;
-GdkDisplay *gdisplay;
-Window root, gnome_win, systray, sidewalk[2];
-Colormap cmap;
-Screen *xscreen;
-int screen;
-int depth;
-int workspace;
-int margins[4];
-int gnome_margins[4];
-int quit = FALSE, reload = FALSE;
-int shape, shape_event;
-Cursor resize_cursor[7], move_cursor, busy_cursor, root_cursor;
-SessionClient *client_session;
+MainData *md = NULL;
static int
handleXError (Display * dpy, XErrorEvent * err)
@@ -90,10 +75,10 @@ handleXError (Display * dpy, XErrorEvent * err)
switch (err->error_code)
{
case BadAccess:
- if (err->resourceid == root)
+ if (err->resourceid == md->xroot)
{
g_message ("%s: Another window manager is running\n",
- progname);
+ md->progname);
exit (1);
}
break;
@@ -119,13 +104,13 @@ cleanUp ()
clientUnframeAll ();
sn_close_display ();
unloadSettings ();
- XFreeCursor (dpy, root_cursor);
- XFreeCursor (dpy, move_cursor);
- XFreeCursor (dpy, busy_cursor);
+ XFreeCursor (md->dpy, md->root_cursor);
+ XFreeCursor (md->dpy, md->move_cursor);
+ XFreeCursor (md->dpy, md->busy_cursor);
sessionFreeWindowStates ();
for (i = 0; i < 7; i++)
{
- XFreeCursor (dpy, resize_cursor[i]);
+ XFreeCursor (md->dpy, md->resize_cursor[i]);
}
for (i = 0; i < NB_KEY_SHORTCUTS; i++)
{
@@ -137,10 +122,11 @@ cleanUp ()
}
g_free (params.workspace_names);
params.workspace_names = NULL;
- removeTmpEventWin (sidewalk[0]);
- removeTmpEventWin (sidewalk[1]);
- XSetInputFocus (dpy, root, RevertToPointerRoot, GDK_CURRENT_TIME);
- closeEventFilter ();
+ removeTmpEventWin (md->sidewalk[0]);
+ removeTmpEventWin (md->sidewalk[1]);
+ XSetInputFocus (md->dpy, md->xroot, RevertToPointerRoot, GDK_CURRENT_TIME);
+ closeEventFilter (md->gtox_data);
+ g_free (md);
}
static char *build_session_filename(SessionClient *client_session)
@@ -204,7 +190,7 @@ static void
session_die (gpointer client_data)
{
gtk_main_quit ();
- quit = TRUE;
+ md->quit = TRUE;
}
static void
@@ -217,11 +203,11 @@ handleSignal (int sig)
case SIGINT:
case SIGTERM:
gtk_main_quit ();
- quit = TRUE;
+ md->quit = TRUE;
break;
case SIGHUP:
case SIGUSR1:
- reload = TRUE;
+ md->reload = TRUE;
break;
case SIGSEGV:
cleanUp ();
@@ -240,121 +226,122 @@ initialize (int argc, char **argv)
int dummy;
long ws;
GdkWindow *groot;
+ SessionClient *client_session;
TRACE ("entering initialize");
- progname = argv[0];
+ md = g_new0 (MainData, 1);
+
+ md->quit = FALSE;
+ md->reload = FALSE;
+ md->progname = argv[0];
xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
gtk_set_locale ();
gtk_init (&argc, &argv);
- gscr = gdk_screen_get_default ();
- if (!gscr)
+ md->gscr = gdk_screen_get_default ();
+ if (!md->gscr)
{
g_error (_("Cannot get default screen\n"));
}
- gdisplay = gdk_screen_get_display (gscr);
- gtk_widget_push_colormap(gdk_screen_get_rgb_colormap (gscr));
- dpy = gdk_x11_display_get_xdisplay (gdisplay);
- xscreen = gdk_x11_screen_get_xscreen (gscr);
- groot = gdk_screen_get_root_window (gscr);
- root = (Window) gdk_x11_drawable_get_xid (groot);
- screen = gdk_screen_get_number (gscr);
- cmap = GDK_COLORMAP_XCOLORMAP(gdk_screen_get_rgb_colormap (gscr));
+ md->gdisplay = gdk_screen_get_display (md->gscr);
+ gtk_widget_push_colormap(gdk_screen_get_rgb_colormap (md->gscr));
+ md->dpy = gdk_x11_display_get_xdisplay (md->gdisplay);
+ md->xscreen = gdk_x11_screen_get_xscreen (md->gscr);
+ groot = gdk_screen_get_root_window (md->gscr);
+ md->xroot = (Window) gdk_x11_drawable_get_xid (groot);
+ md->screen = gdk_screen_get_number (md->gscr);
+ md->cmap = GDK_COLORMAP_XCOLORMAP(gdk_screen_get_rgb_colormap (md->gscr));
DBG ("xfwm4 starting, using GTK+-%d.%d.%d", gtk_major_version,
gtk_minor_version, gtk_micro_version);
- xfce_setenv ("DISPLAY", gdk_display_get_name (gdisplay), TRUE);
+ xfce_setenv ("DISPLAY", gdk_display_get_name (md->gdisplay), TRUE);
- depth = DefaultDepth (dpy, screen);
- sn_init_display (dpy, screen);
- workspace = 0;
+ md->depth = DefaultDepth (md->dpy, md->screen);
+ sn_init_display (md->dpy, md->screen);
+ md->current_ws = 0;
XSetErrorHandler (handleXError);
- shape = XShapeQueryExtension (dpy, &shape_event, &dummy);
-
- client_session =
- client_session_new (argc, argv, NULL, SESSION_RESTART_IF_RUNNING, 20);
- client_session->data = (gpointer) client_session;
- client_session->save_phase_2 = save_phase_2;
- client_session->die = session_die;
-
- if (session_init (client_session))
- {
- load_saved_session (client_session);
- }
+ md->shape = XShapeQueryExtension (md->dpy, &md->shape_event, &dummy);
/* Create the side windows to detect edge movement */
- sidewalk[0] = setTmpEventWin (0, 0,
- 1, gdk_screen_get_height (gscr),
+ md->sidewalk[0] = setTmpEventWin (0, 0,
+ 1, gdk_screen_get_height (md->gscr),
LeaveWindowMask | PointerMotionMask);
- sidewalk[1] = setTmpEventWin (gdk_screen_get_width (gscr) - 1, 0,
- 1, gdk_screen_get_height (gscr),
+ md->sidewalk[1] = setTmpEventWin (gdk_screen_get_width (md->gscr) - 1, 0,
+ 1, gdk_screen_get_height (md->gscr),
LeaveWindowMask | PointerMotionMask);
- margins[TOP] = gnome_margins[TOP] = 0;
- margins[LEFT] = gnome_margins[LEFT] = 0;
- margins[RIGHT] = gnome_margins[RIGHT] = 0;
- margins[BOTTOM] = gnome_margins[BOTTOM] = 0;
-
- initICCCMHints (dpy);
- initMotifHints (dpy);
- initGnomeHints (dpy);
- initNetHints (dpy);
- initKDEHints (dpy);
- initSystrayHints (dpy, screen);
+ md->margins[TOP] = md->gnome_margins[TOP] = 0;
+ md->margins[LEFT] = md->gnome_margins[LEFT] = 0;
+ md->margins[RIGHT] = md->gnome_margins[RIGHT] = 0;
+ md->margins[BOTTOM] = md->gnome_margins[BOTTOM] = 0;
+
+ initICCCMHints (md->dpy);
+ initMotifHints (md->dpy);
+ initGnomeHints (md->dpy);
+ initNetHints (md->dpy);
+ initKDEHints (md->dpy);
+ initSystrayHints (md->dpy, md->screen);
- initModifiers (dpy);
-
- root_cursor = XCreateFontCursor (dpy, XC_left_ptr);
- move_cursor = XCreateFontCursor (dpy, XC_fleur);
- busy_cursor = cursorCreateSpinning (dpy, root);
- resize_cursor[CORNER_TOP_LEFT] =
- XCreateFontCursor (dpy, XC_top_left_corner);
- resize_cursor[CORNER_TOP_RIGHT] =
- XCreateFontCursor (dpy, XC_top_right_corner);
- resize_cursor[CORNER_BOTTOM_LEFT] =
- XCreateFontCursor (dpy, XC_bottom_left_corner);
- resize_cursor[CORNER_BOTTOM_RIGHT] =
- XCreateFontCursor (dpy, XC_bottom_right_corner);
- resize_cursor[4 + SIDE_LEFT] = XCreateFontCursor (dpy, XC_left_side);
- resize_cursor[4 + SIDE_RIGHT] = XCreateFontCursor (dpy, XC_right_side);
- resize_cursor[4 + SIDE_BOTTOM] = XCreateFontCursor (dpy, XC_bottom_side);
-
- XDefineCursor (dpy, root, root_cursor);
-
- if (!initEventFilter (MAIN_EVENT_MASK, NULL, "xfwm"))
+ initModifiers (md->dpy);
+
+ md->root_cursor = XCreateFontCursor (md->dpy, XC_left_ptr);
+ md->move_cursor = XCreateFontCursor (md->dpy, XC_fleur);
+ md->busy_cursor = cursorCreateSpinning (md->dpy, md->xroot);
+ md->resize_cursor[CORNER_TOP_LEFT] =
+ XCreateFontCursor (md->dpy, XC_top_left_corner);
+ md->resize_cursor[CORNER_TOP_RIGHT] =
+ XCreateFontCursor (md->dpy, XC_top_right_corner);
+ md->resize_cursor[CORNER_BOTTOM_LEFT] =
+ XCreateFontCursor (md->dpy, XC_bottom_left_corner);
+ md->resize_cursor[CORNER_BOTTOM_RIGHT] =
+ XCreateFontCursor (md->dpy, XC_bottom_right_corner);
+ md->resize_cursor[4 + SIDE_LEFT] = XCreateFontCursor (md->dpy, XC_left_side);
+ md->resize_cursor[4 + SIDE_RIGHT] = XCreateFontCursor (md->dpy, XC_right_side);
+ md->resize_cursor[4 + SIDE_BOTTOM] = XCreateFontCursor (md->dpy, XC_bottom_side);
+
+ XDefineCursor (md->dpy, md->xroot, md->root_cursor);
+
+ md->gtox_data = initEventFilter (md->gscr, MAIN_EVENT_MASK, NULL, "xfwm");
+ if (!md->gtox_data)
{
return -1;
}
- pushEventFilter (xfwm4_event_filter, NULL);
+ pushEventFilter (md->gtox_data, xfwm4_event_filter, NULL);
- gnome_win = getDefaultXWindow ();
- DBG ("Our event window is 0x%lx", gnome_win);
+ md->gnome_win = getDefaultXWindow (md->gtox_data);
+ DBG ("Our event window is 0x%lx", md->gnome_win);
if (!initSettings ())
{
return -2;
}
- systray = getSystrayWindow (dpy);
- setGnomeProtocols (dpy, screen, gnome_win);
- setHint (dpy, root, win_supporting_wm_check, gnome_win);
- setHint (dpy, root, win_desktop_button_proxy, gnome_win);
- setHint (dpy, gnome_win, win_desktop_button_proxy, gnome_win);
- getHint (dpy, root, win_workspace, &ws);
- workspace = (int) ws;
- getGnomeDesktopMargins (dpy, screen, gnome_margins);
- set_utf8_string_hint (dpy, gnome_win, net_wm_name, "Xfwm4");
- setNetSupportedHint (dpy, screen, gnome_win);
- workspaceUpdateArea (margins, gnome_margins);
- initNetDesktopParams (dpy, screen, workspace);
- setNetWorkarea (dpy, screen, params.workspace_count, margins);
- XSetInputFocus (dpy, gnome_win, RevertToPointerRoot, GDK_CURRENT_TIME);
+ md->systray = getSystrayWindow (md->dpy);
+ setGnomeProtocols (md->dpy, md->screen, md->gnome_win);
+ setHint (md->dpy, md->xroot, win_supporting_wm_check, md->gnome_win);
+ setHint (md->dpy, md->xroot, win_desktop_button_proxy, md->gnome_win);
+ setHint (md->dpy, md->gnome_win, win_desktop_button_proxy, md->gnome_win);
+ getHint (md->dpy, md->xroot, win_workspace, &ws);
+ md->current_ws = (int) ws;
+ getGnomeDesktopMargins (md->dpy, md->screen, md->gnome_margins);
+ set_utf8_string_hint (md->dpy, md->gnome_win, net_wm_name, "Xfwm4");
+ setNetSupportedHint (md->dpy, md->screen, md->gnome_win);
+ workspaceUpdateArea (md->margins, md->gnome_margins);
+ initNetDesktopParams (md->dpy, md->screen,
+ md->current_ws,
+ gdk_screen_get_width (md->gscr),
+ gdk_screen_get_height (md->gscr));
+ setNetWorkarea (md->dpy, md->screen, params.workspace_count,
+ gdk_screen_get_width (md->gscr),
+ gdk_screen_get_height (md->gscr),
+ md->margins);
+ XSetInputFocus (md->dpy, md->gnome_win, RevertToPointerRoot, GDK_CURRENT_TIME);
initGtkCallbacks ();
/* The first time the first Gtk application on a display uses pango,
@@ -362,7 +349,7 @@ initialize (int argc, char **argv)
* Therefore, force the cache window to be created now instead of
* trying to do it while we have another grab and deadlocking the server.
*/
- layout = gtk_widget_create_pango_layout (getDefaultGtkWidget (), "-");
+ layout = gtk_widget_create_pango_layout (getDefaultGtkWidget (md->gtox_data), "-");
pango_layout_get_pixel_extents (layout, NULL, NULL);
g_object_unref (G_OBJECT (layout));
@@ -377,6 +364,17 @@ initialize (int argc, char **argv)
sigaction (SIGUSR1, &act, NULL);
sigaction (SIGSEGV, &act, NULL);
+ client_session =
+ client_session_new (argc, argv, NULL, SESSION_RESTART_IF_RUNNING, 20);
+ client_session->data = (gpointer) client_session;
+ client_session->save_phase_2 = save_phase_2;
+ client_session->die = session_die;
+
+ if (session_init (client_session))
+ {
+ load_saved_session (client_session);
+ }
+
return 0;
}
diff --git a/src/main.h b/src/main.h
index 033c4b052..0e7f44326 100644
--- a/src/main.h
+++ b/src/main.h
@@ -55,20 +55,35 @@
*
*/
-extern char *progname;
-extern Display *dpy;
-extern GdkScreen *gscr;
-extern GdkDisplay *gdisplay;
-extern Window root, gnome_win, systray, sidewalk[2];
-extern Screen *xscreen;
-extern int screen;
-extern int depth;
-extern int workspace;
-extern Colormap cmap;
-extern int gnome_margins[4];
-extern int margins[4];
-extern int quit, reload;
-extern int shape, shape_event;
-extern Cursor resize_cursor[7], move_cursor, busy_cursor, root_cursor;
+typedef struct MainData
+{
+ Colormap cmap;
+ Cursor busy_cursor;
+ Cursor move_cursor;
+ Cursor resize_cursor[7];
+ Cursor root_cursor;
+ Display *dpy;
+ GdkDisplay *gdisplay;
+ GdkScreen *gscr;
+ GtkToXEventFilterSetup *gtox_data;
+ Screen *xscreen;
+ Window gnome_win;
+ Window xroot;
+ Window sidewalk[2];
+ Window systray;
+ char *progname;
+ int depth;
+ int gnome_margins[4];
+ int margins[4];
+ int quit;
+ int reload;
+ int screen;
+ int shape;
+ int shape_event;
+ int current_ws;
+}
+MainData;
+
+extern MainData *md;
#endif /* INC_MAIN_H */
diff --git a/src/menu.c b/src/menu.c
index be70d7ca9..d6e932787 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- Metacity - (c) 2001 Havoc Pennington
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ Metacity - (c) 2001 Havoc Pennington
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -32,6 +32,7 @@
#include <libxfce4util/libxfce4util.h>
#include <libxfcegui4/libxfcegui4.h>
#include "menu.h"
+#include "main.h"
static GtkWidget *menu_open = NULL;
static MenuItem menuitems[] = {
@@ -64,18 +65,18 @@ menu_filter (XEvent * xevent, gpointer data)
{
switch (xevent->type)
{
- case KeyPress:
- case KeyRelease:
- case ButtonPress:
- case ButtonRelease:
- case MotionNotify:
- case EnterNotify:
- case LeaveNotify:
- return XEV_FILTER_STOP;
- break;
- default:
- return XEV_FILTER_CONTINUE;
- break;
+ case KeyPress:
+ case KeyRelease:
+ case ButtonPress:
+ case ButtonRelease:
+ case MotionNotify:
+ case EnterNotify:
+ case LeaveNotify:
+ return XEV_FILTER_STOP;
+ break;
+ default:
+ return XEV_FILTER_CONTINUE;
+ break;
}
return XEV_FILTER_STOP;
}
@@ -94,21 +95,21 @@ popup_position_func (GtkMenu * menu, gint * x, gint * y, gboolean * push_in,
if (pos->x >= 0)
{
- *x = pos->x;
- *x = CLAMP (*x, 0, MAX (0, gdk_screen_width () - req.width));
+ *x = pos->x;
+ *x = CLAMP (*x, 0, MAX (0, gdk_screen_width () - req.width));
}
else
{
- *x = (gdk_screen_width () - req.width) / 2;
+ *x = (gdk_screen_width () - req.width) / 2;
}
if (pos->x >= 0)
{
- *y = pos->y;
- *y = CLAMP (*y, 0, MAX (0, gdk_screen_height () - req.height));
+ *y = pos->y;
+ *y = CLAMP (*y, 0, MAX (0, gdk_screen_height () - req.height));
}
else
{
- *y = (gdk_screen_height () - req.height) / 2;
+ *y = (gdk_screen_height () - req.height) / 2;
}
g_free (user_data);
}
@@ -116,19 +117,22 @@ popup_position_func (GtkMenu * menu, gint * x, gint * y, gboolean * push_in,
static gboolean
activate_cb (GtkWidget * menuitem, gpointer data)
{
- MenuData *md;
+ MenuData *menudata;
TRACE ("entering activate_cb");
g_return_val_if_fail (GTK_IS_WIDGET (menuitem), FALSE);
menu_open = NULL;
- md = data;
+ menudata = data;
TRACE ("deactivating menu_filter");
- popEventFilter ();
- (*md->menu->func) (md->menu, md->op, md->client_xwindow, md->menu->data,
- md->data);
+ popEventFilter (md->gtox_data);
+ (*menudata->menu->func) (menudata->menu,
+ menudata->op,
+ menudata->client_xwindow,
+ menudata->menu->data,
+ menudata->data);
return (FALSE);
}
@@ -141,7 +145,7 @@ menu_closed (GtkMenu * widget, gpointer data)
menu = data;
menu_open = NULL;
TRACE ("deactivating menu_filter");
- popEventFilter ();
+ popEventFilter (md->gtox_data);
(*menu->func) (menu, 0, None, menu->data, NULL);
return (FALSE);
}
@@ -151,8 +155,8 @@ menu_workspace (Menu * menu, MenuOp insensitive, gint ws, gint nws, gchar *wsn,
{
gint i;
GtkWidget *menu_widget;
- GtkWidget *mi;
- MenuData *md;
+ GtkWidget *menuitem;
+ MenuData *menudata;
gchar *name;
gchar *ptr = wsn;
@@ -160,39 +164,39 @@ menu_workspace (Menu * menu, MenuOp insensitive, gint ws, gint nws, gchar *wsn,
for (i = 0; i < nws; i++)
{
- if (ptr && *ptr)
- {
- name = g_strdup_printf (_("Workspace %i (%s)"), i + 1, ptr);
- if (ptr - wsn + 1 < wsnl)
- {
- ptr += strlen (ptr) + 1;
- }
- else
- {
- ptr = NULL;
- }
- }
- else
- {
- name = g_strdup_printf (_("Workspace %i"), i + 1);
- }
- mi = gtk_check_menu_item_new_with_label (name);
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), (i == ws));
- gtk_widget_show (mi);
- if (insensitive & MENU_OP_WORKSPACES)
- {
- gtk_widget_set_sensitive (mi, FALSE);
- }
- g_free (name);
-
- md = g_new (MenuData, 1);
- md->menu = menu;
- md->op = MENU_OP_WORKSPACES;
- md->client_xwindow = None;
- md->data = GINT_TO_POINTER (i);
- menu_item_connect (mi, md);
-
- gtk_menu_shell_append (GTK_MENU_SHELL (menu_widget), mi);
+ if (ptr && *ptr)
+ {
+ name = g_strdup_printf (_("Workspace %i (%s)"), i + 1, ptr);
+ if (ptr - wsn + 1 < wsnl)
+ {
+ ptr += strlen (ptr) + 1;
+ }
+ else
+ {
+ ptr = NULL;
+ }
+ }
+ else
+ {
+ name = g_strdup_printf (_("Workspace %i"), i + 1);
+ }
+ menuitem = gtk_check_menu_item_new_with_label (name);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), (i == ws));
+ gtk_widget_show (menuitem);
+ if (insensitive & MENU_OP_WORKSPACES)
+ {
+ gtk_widget_set_sensitive (menuitem, FALSE);
+ }
+ g_free (name);
+
+ menudata = g_new (MenuData, 1);
+ menudata->menu = menu;
+ menudata->op = MENU_OP_WORKSPACES;
+ menudata->client_xwindow = None;
+ menudata->data = GINT_TO_POINTER (i);
+ menu_item_connect (menuitem, menudata);
+
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu_widget), menuitem);
}
return (menu_widget);
@@ -216,68 +220,67 @@ menu_default (MenuOp ops, MenuOp insensitive, MenuFunc func, gint ws,
i = 0;
while (i < (int) (sizeof (menuitems) / sizeof (MenuItem)))
{
- if ((ops & menuitems[i].op) || (menuitems[i].op == MENU_OP_SEPARATOR))
- {
- GtkWidget *mi;
- GtkWidget *image;
- GtkWidget *ws_menu;
- MenuData *md;
- const gchar *label;
-
- label = _(menuitems[i].label);
- ws_menu = NULL;
- switch (menuitems[i].op)
- {
- case MENU_OP_SEPARATOR:
- mi = gtk_separator_menu_item_new ();
- break;
- case MENU_OP_WORKSPACES:
- mi = gtk_menu_item_new_with_mnemonic (label);
- if (insensitive & menuitems[i].op)
- {
- gtk_widget_set_sensitive (mi, FALSE);
- }
- ws_menu = menu_workspace (menu, insensitive, ws, nws, wsn, wsnl);
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (mi), ws_menu);
-
- md = g_new (MenuData, 1);
- md->menu = menu;
- md->op = menuitems[i].op;
- md->client_xwindow = None;
- md->data = NULL;
- break;
- default:
- if (menuitems[i].image_name)
- {
- mi = gtk_image_menu_item_new_with_mnemonic (label);
- image =
- gtk_image_new_from_stock (menuitems[i].image_name,
- GTK_ICON_SIZE_MENU);
- gtk_widget_show (image);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM
- (mi), image);
-
- }
- else
- {
- mi = gtk_menu_item_new_with_mnemonic (label);
- }
- if (insensitive & menuitems[i].op)
- {
- gtk_widget_set_sensitive (mi, FALSE);
- }
- md = g_new (MenuData, 1);
- md->menu = menu;
- md->op = menuitems[i].op;
- md->client_xwindow = None;
- md->data = NULL;
- menu_item_connect (mi, md);
- break;
- }
- gtk_menu_shell_append (GTK_MENU_SHELL (menu->menu), mi);
- gtk_widget_show (mi);
- }
- ++i;
+ if ((ops & menuitems[i].op) || (menuitems[i].op == MENU_OP_SEPARATOR))
+ {
+ GtkWidget *menuitem;
+ GtkWidget *image;
+ GtkWidget *ws_menu;
+ MenuData *menudata;
+ const gchar *label;
+
+ label = _(menuitems[i].label);
+ ws_menu = NULL;
+ switch (menuitems[i].op)
+ {
+ case MENU_OP_SEPARATOR:
+ menuitem = gtk_separator_menu_item_new ();
+ break;
+ case MENU_OP_WORKSPACES:
+ menuitem = gtk_menu_item_new_with_mnemonic (label);
+ if (insensitive & menuitems[i].op)
+ {
+ gtk_widget_set_sensitive (menuitem, FALSE);
+ }
+ ws_menu = menu_workspace (menu, insensitive, ws, nws, wsn, wsnl);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), ws_menu);
+
+ menudata = g_new (MenuData, 1);
+ menudata->menu = menu;
+ menudata->op = menuitems[i].op;
+ menudata->client_xwindow = None;
+ menudata->data = NULL;
+ break;
+ default:
+ if (menuitems[i].image_name)
+ {
+ menuitem = gtk_image_menu_item_new_with_mnemonic (label);
+ image =
+ gtk_image_new_from_stock (menuitems[i].image_name,
+ GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
+
+ }
+ else
+ {
+ menuitem = gtk_menu_item_new_with_mnemonic (label);
+ }
+ if (insensitive & menuitems[i].op)
+ {
+ gtk_widget_set_sensitive (menuitem, FALSE);
+ }
+ menudata = g_new (MenuData, 1);
+ menudata->menu = menu;
+ menudata->op = menuitems[i].op;
+ menudata->client_xwindow = None;
+ menudata->data = NULL;
+ menu_item_connect (menuitem, menudata);
+ break;
+ }
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu->menu), menuitem);
+ gtk_widget_show (menuitem);
+ }
+ ++i;
}
menu_connect (menu);
@@ -291,7 +294,7 @@ menu_connect (Menu * menu)
g_return_val_if_fail (menu != NULL, NULL);
g_return_val_if_fail (GTK_IS_MENU (menu->menu), NULL);
g_signal_connect (GTK_OBJECT (menu->menu), "selection_done",
- GTK_SIGNAL_FUNC (menu_closed), menu);
+ GTK_SIGNAL_FUNC (menu_closed), menu);
return (menu);
}
@@ -301,8 +304,8 @@ closure_notify (gpointer data, GClosure * closure)
TRACE ("entering closure_notify");
if (data)
{
- TRACE ("freeing data");
- g_free (data);
+ TRACE ("freeing data");
+ g_free (data);
}
}
@@ -313,8 +316,8 @@ menu_item_connect (GtkWidget * item, MenuData * item_data)
g_return_val_if_fail (item != NULL, NULL);
g_return_val_if_fail (GTK_IS_MENU_ITEM (item), NULL);
g_signal_connect_closure (GTK_OBJECT (item), "activate",
- g_cclosure_new (GTK_SIGNAL_FUNC (activate_cb), item_data,
- (GClosureNotify) closure_notify), FALSE);
+ g_cclosure_new (GTK_SIGNAL_FUNC (activate_cb), item_data,
+ (GClosureNotify) closure_notify), FALSE);
return (item);
}
@@ -331,10 +334,10 @@ menu_check_and_close (void)
TRACE ("entering menu_check_or_close");
if (menu_open)
{
- TRACE ("menu open, emitting deactivate signal");
- g_signal_emit_by_name (GTK_OBJECT (menu_open), "deactivate");
- menu_open = NULL;
- return (TRUE);
+ TRACE ("menu open, emitting deactivate signal");
+ g_signal_emit_by_name (GTK_OBJECT (menu_open), "deactivate");
+ menu_open = NULL;
+ return (TRUE);
}
return (FALSE);
}
@@ -343,9 +346,9 @@ static gboolean
grab_available (guint32 timestamp)
{
GdkEventMask mask =
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
- GDK_POINTER_MOTION_MASK;
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
+ GDK_POINTER_MOTION_MASK;
GdkGrabStatus g1;
GdkGrabStatus g2;
gboolean grab_failed = FALSE;
@@ -353,33 +356,33 @@ grab_available (guint32 timestamp)
TRACE ("entering grab_available");
- g1 = gdk_pointer_grab (getGdkEventWindow (), TRUE, mask, NULL, NULL,
- timestamp);
- g2 = gdk_keyboard_grab (getGdkEventWindow (), TRUE, timestamp);
+ g1 = gdk_pointer_grab (getGdkEventWindow (md->gtox_data), TRUE, mask, NULL, NULL,
+ timestamp);
+ g2 = gdk_keyboard_grab (getGdkEventWindow (md->gtox_data), TRUE, timestamp);
while ((i++ < 100) && (grab_failed = ((g1 != GDK_GRAB_SUCCESS)
- || (g2 != GDK_GRAB_SUCCESS))))
+ || (g2 != GDK_GRAB_SUCCESS))))
{
- TRACE ("grab not available yet, waiting... (%i)", i);
- g_usleep (100);
- if (g1 != GDK_GRAB_SUCCESS)
- {
- g1 = gdk_pointer_grab (getGdkEventWindow (), TRUE, mask, NULL,
- NULL, timestamp);
- }
- if (g2 != GDK_GRAB_SUCCESS)
- {
- g2 = gdk_keyboard_grab (getGdkEventWindow (), TRUE, timestamp);
- }
+ TRACE ("grab not available yet, waiting... (%i)", i);
+ g_usleep (100);
+ if (g1 != GDK_GRAB_SUCCESS)
+ {
+ g1 = gdk_pointer_grab (getGdkEventWindow (md->gtox_data), TRUE, mask, NULL,
+ NULL, timestamp);
+ }
+ if (g2 != GDK_GRAB_SUCCESS)
+ {
+ g2 = gdk_keyboard_grab (getGdkEventWindow (md->gtox_data), TRUE, timestamp);
+ }
}
if (g1 == GDK_GRAB_SUCCESS)
{
- gdk_pointer_ungrab (timestamp);
+ gdk_pointer_ungrab (timestamp);
}
if (g2 == GDK_GRAB_SUCCESS)
{
- gdk_keyboard_ungrab (timestamp);
+ gdk_keyboard_ungrab (timestamp);
}
return (!grab_failed);
@@ -402,28 +405,28 @@ menu_popup (Menu * menu, int root_x, int root_y, int button,
if (!menu_check_and_close ())
{
- if (!grab_available (timestamp))
- {
- g_free (pt);
- TRACE ("Cannot get grab on pointer/keyboard, cancel.");
- return FALSE;
- }
- TRACE ("opening new menu");
- menu_open = menu->menu;
- pushEventFilter (menu_filter, NULL);
- gtk_menu_popup (GTK_MENU (menu->menu), NULL, NULL,
- popup_position_func, pt, 0, timestamp);
-
- if (!GTK_MENU_SHELL (GTK_MENU (menu->menu))->have_xgrab)
- {
- gdk_beep ();
- g_message (_("%s: GtkMenu failed to grab the pointer\n"),
- g_get_prgname ());
- gtk_menu_popdown (GTK_MENU (menu->menu));
- menu_open = NULL;
- popEventFilter ();
- return FALSE;
- }
+ if (!grab_available (timestamp))
+ {
+ g_free (pt);
+ TRACE ("Cannot get grab on pointer/keyboard, cancel.");
+ return FALSE;
+ }
+ TRACE ("opening new menu");
+ menu_open = menu->menu;
+ pushEventFilter (md->gtox_data, menu_filter, NULL);
+ gtk_menu_popup (GTK_MENU (menu->menu), NULL, NULL,
+ popup_position_func, pt, 0, timestamp);
+
+ if (!GTK_MENU_SHELL (GTK_MENU (menu->menu))->have_xgrab)
+ {
+ gdk_beep ();
+ g_message (_("%s: GtkMenu failed to grab the pointer\n"),
+ g_get_prgname ());
+ gtk_menu_popdown (GTK_MENU (menu->menu));
+ menu_open = NULL;
+ popEventFilter (md->gtox_data);
+ return FALSE;
+ }
}
return TRUE;
}
diff --git a/src/menu.h b/src/menu.h
index 967d733b8..d59d03bc1 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- Metacity - (c) 2001 Havoc Pennington
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ Metacity - (c) 2001 Havoc Pennington
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -58,7 +58,7 @@ typedef struct _MenuItem MenuItem;
typedef struct _MenuData MenuData;
typedef void (*MenuFunc) (Menu * menu, MenuOp op, Window client_xwindow,
- gpointer menu_data, gpointer item_data);
+ gpointer menu_data, gpointer item_data);
struct _MenuItem
{
@@ -85,13 +85,13 @@ struct _Menu
};
Menu *menu_default (MenuOp ops, MenuOp insensitive, MenuFunc func,
- gint ws, gint nws, gchar *wsn, gint wsnl, gpointer data);
+ gint ws, gint nws, gchar *wsn, gint wsnl, gpointer data);
Menu *menu_connect (Menu * menu);
GtkWidget *menu_item_connect (GtkWidget * item, MenuData * item_data);
gboolean menu_is_opened (void);
gboolean menu_check_and_close (void);
gboolean menu_popup (Menu * menu, int root_x, int root_y, int button,
- guint32 timestamp);
+ guint32 timestamp);
void menu_free (Menu * menu);
#endif /* INC_MENU_H */
diff --git a/src/misc.c b/src/misc.c
index b10a69c1c..ba76a5f3c 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -49,7 +49,7 @@ getMouseXY (Window w, int *x2, int *y2)
TRACE ("entering getMouseXY");
- XQueryPointer (dpy, w, &w1, &w2, &x1, &y1, x2, y2, &m);
+ XQueryPointer (md->dpy, w, &w1, &w2, &x1, &y1, x2, y2, &m);
}
Window
@@ -60,7 +60,7 @@ getMouseWindow (Window w)
TRACE ("entering getMouseWindow");
- XQueryPointer (dpy, w, &w1, &w2, &x1, &y1, &x2, &y2, &m);
+ XQueryPointer (md->dpy, w, &w1, &w2, &x1, &y1, &x2, &y2, &m);
return w2;
}
@@ -77,7 +77,7 @@ createGC (Colormap cmap, char *col, int func, XFontStruct * font,
TRACE ("color=%s", col);
mask = GCForeground | GCFunction;
- XAllocNamedColor (dpy, cmap, col, &xc1, &xc2);
+ XAllocNamedColor (md->dpy, cmap, col, &xc1, &xc2);
gv.foreground = xc2.pixel;
gv.function = func;
if (font)
@@ -95,7 +95,7 @@ createGC (Colormap cmap, char *col, int func, XFontStruct * font,
gv.line_width = line_width;
mask = mask | GCLineWidth;
}
- gc = XCreateGC (dpy, XDefaultRootWindow (dpy), mask, &gv);
+ gc = XCreateGC (md->dpy, XDefaultRootWindow (md->dpy), mask, &gv);
return gc;
}
@@ -112,7 +112,7 @@ sendClientMessage (Window w, Atom a, Atom x, Time timestamp)
ev.format = 32;
ev.data.l[0] = x;
ev.data.l[1] = timestamp;
- XSendEvent (dpy, w, FALSE, 0L, (XEvent *)&ev);
+ XSendEvent (md->dpy, w, FALSE, 0L, (XEvent *)&ev);
}
void
@@ -122,7 +122,7 @@ myXGrabServer (void)
if (xgrabcount == 0)
{
DBG ("grabbing server");
- XGrabServer (dpy);
+ XGrabServer (md->dpy);
}
xgrabcount++;
DBG ("grabs : %i", xgrabcount);
@@ -139,15 +139,15 @@ myXUngrabServer (void)
if (xgrabcount == 0)
{
DBG ("ungrabbing server");
- XUngrabServer (dpy);
- XFlush (dpy);
+ XUngrabServer (md->dpy);
+ XFlush (md->dpy);
}
DBG ("grabs : %i", xgrabcount);
}
/*
* it's safer to grab the display before calling this routine
- * Returns true if the given window is present and mapped on root
+ * Returns true if the given window is present and mapped on md->xroot
*/
gboolean
myCheckWindow(Window w)
@@ -160,7 +160,7 @@ myCheckWindow(Window w)
g_return_val_if_fail (w != None, FALSE);
gdk_error_trap_push ();
- test = XQueryTree(dpy, w, &dummy_root, &parent, &wins, &count);
+ test = XQueryTree(md->dpy, w, &dummy_root, &parent, &wins, &count);
if (wins)
{
XFree (wins);
@@ -176,43 +176,43 @@ setTmpEventWin (int x, int y, unsigned int w, unsigned int h, long eventmask)
attributes.event_mask = eventmask;
attributes.override_redirect = TRUE;
- win = XCreateWindow (dpy, root, x, y, w, h, 0, 0,
+ win = XCreateWindow (md->dpy, md->xroot, x, y, w, h, 0, 0,
InputOnly, CopyFromParent,
CWEventMask | CWOverrideRedirect, &attributes);
- XMapRaised (dpy, win);
- XFlush (dpy);
+ XMapRaised (md->dpy, win);
+ XFlush (md->dpy);
return (win);
}
void
removeTmpEventWin (Window w)
{
- XDestroyWindow (dpy, w);
+ XDestroyWindow (md->dpy, w);
}
void
placeSidewalks(gboolean activate)
{
- g_return_if_fail (sidewalk[0] != None);
- g_return_if_fail (sidewalk[1] != None);
+ g_return_if_fail (md->sidewalk[0] != None);
+ g_return_if_fail (md->sidewalk[1] != None);
if (activate)
{
- XMoveResizeWindow(dpy, sidewalk[0],
+ XMoveResizeWindow(md->dpy, md->sidewalk[0],
0, 0,
- 1, gdk_screen_get_height (gscr));
- XMoveResizeWindow(dpy, sidewalk[1],
- gdk_screen_get_width (gscr) - 1, 0,
- 1, gdk_screen_get_height (gscr));
+ 1, gdk_screen_get_height (md->gscr));
+ XMoveResizeWindow(md->dpy, md->sidewalk[1],
+ gdk_screen_get_width (md->gscr) - 1, 0,
+ 1, gdk_screen_get_height (md->gscr));
}
else
{
/* Place the windows off screen */
- XMoveResizeWindow(dpy, sidewalk[0],
+ XMoveResizeWindow(md->dpy, md->sidewalk[0],
-1, 0,
- 1, gdk_screen_get_height (gscr));
- XMoveResizeWindow(dpy, sidewalk[1],
- gdk_screen_get_width (gscr), 0,
- 1, gdk_screen_get_height (gscr));
+ 1, gdk_screen_get_height (md->gscr));
+ XMoveResizeWindow(md->dpy, md->sidewalk[1],
+ gdk_screen_get_width (md->gscr), 0,
+ 1, gdk_screen_get_height (md->gscr));
}
}
diff --git a/src/misc.h b/src/misc.h
index 504844357..09808c2f3 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
diff --git a/src/mypixmap.c b/src/mypixmap.c
index ea854e0f2..aa711d095 100644
--- a/src/mypixmap.c
+++ b/src/mypixmap.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -31,8 +31,8 @@
#include <stdlib.h>
#include <stdio.h>
-#include "mypixmap.h"
#include "main.h"
+#include "mypixmap.h"
static gboolean
myPixmapCompose (MyPixmap * pm, gchar * dir, gchar * file)
@@ -50,36 +50,36 @@ myPixmapCompose (MyPixmap * pm, gchar * dir, gchar * file)
if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR))
{
- g_free (filename);
- return FALSE;
+ g_free (filename);
+ return FALSE;
}
alpha = gdk_pixbuf_new_from_file (filename, &error);
g_free (filename);
if (error)
{
- g_warning ("%s", error->message);
- g_error_free (error);
- return FALSE;
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ return FALSE;
}
if (!gdk_pixbuf_get_has_alpha (alpha))
{
- g_object_unref (alpha);
- return FALSE;
+ g_object_unref (alpha);
+ return FALSE;
}
destw = gdk_pixmap_foreign_new (pm->pixmap);
if (!destw)
{
- DBG ("Cannot get pixmap");
- g_object_unref (alpha);
- return FALSE;
+ DBG ("Cannot get pixmap");
+ g_object_unref (alpha);
+ return FALSE;
}
- src = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE (destw), gdk_screen_get_rgb_colormap (gscr),
- 0, 0, 0, 0, pm->width, pm->height);
+ src = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE (destw), gdk_screen_get_rgb_colormap (md->gscr),
+ 0, 0, 0, 0, pm->width, pm->height);
gdk_pixbuf_composite (alpha, src, 0, 0, pm->width, pm->height,
- 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255);
+ 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 255);
gdk_draw_pixbuf (GDK_DRAWABLE (destw), NULL, src, 0, 0, 0, 0,
- pm->width, pm->height, GDK_RGB_DITHER_NONE, 0, 0);
+ pm->width, pm->height, GDK_RGB_DITHER_NONE, 0, 0);
g_object_unref (alpha);
g_object_unref (src);
g_object_unref (destw);
@@ -109,19 +109,19 @@ myPixmapLoad (Display * dpy, MyPixmap * pm, gchar * dir, gchar * file,
g_free (filexpm);
attr.colorsymbols = cs;
attr.numsymbols = n;
- attr.colormap = cmap;
+ attr.colormap = md->cmap;
attr.closeness = 65535;
attr.valuemask = XpmCloseness | XpmColormap | XpmSize;
if (n > 0 && cs)
{
- attr.valuemask = attr.valuemask | XpmColorSymbols;
+ attr.valuemask = attr.valuemask | XpmColorSymbols;
}
if (XpmReadFileToPixmap (dpy, XDefaultRootWindow (dpy), filename,
- &pm->pixmap, &pm->mask, &attr))
+ &pm->pixmap, &pm->mask, &attr))
{
- TRACE ("%s not found", filename);
- g_free (filename);
- return FALSE;
+ TRACE ("%s not found", filename);
+ g_free (filename);
+ return FALSE;
}
pm->width = attr.width;
pm->height = attr.height;
@@ -140,14 +140,14 @@ myPixmapCreate (Display * dpy, MyPixmap * pm, gint width, gint height)
TRACE ("entering myPixmapCreate, width=%i, height=%i", width, height);
if ((width < 1) || (height < 1))
{
- myPixmapInit (pm);
+ myPixmapInit (pm);
}
else
{
- pm->pixmap = XCreatePixmap (dpy, root, width, height, depth);
- pm->mask = XCreatePixmap (dpy, pm->pixmap, width, height, 1);
- pm->width = width;
- pm->height = height;
+ pm->pixmap = XCreatePixmap (dpy, md->xroot, width, height, md->depth);
+ pm->mask = XCreatePixmap (dpy, pm->pixmap, width, height, 1);
+ pm->width = width;
+ pm->height = height;
}
}
@@ -167,12 +167,12 @@ myPixmapFree (Display * dpy, MyPixmap * pm)
if (pm->pixmap != None)
{
- XFreePixmap (dpy, pm->pixmap);
- pm->pixmap = None;
+ XFreePixmap (dpy, pm->pixmap);
+ pm->pixmap = None;
}
if (pm->mask != None)
{
- XFreePixmap (dpy, pm->mask);
- pm->mask = None;
+ XFreePixmap (dpy, pm->mask);
+ pm->mask = None;
}
}
diff --git a/src/mypixmap.h b/src/mypixmap.h
index defe5f41e..03bcd3806 100644
--- a/src/mypixmap.h
+++ b/src/mypixmap.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -36,7 +36,7 @@ typedef struct
MyPixmap;
gboolean myPixmapLoad (Display *, MyPixmap *, gchar *, gchar *,
- XpmColorSymbol *, gint);
+ XpmColorSymbol *, gint);
void myPixmapCreate (Display *, MyPixmap *, gint, gint);
void myPixmapInit (MyPixmap *);
void myPixmapFree (Display *, MyPixmap *);
diff --git a/src/mywindow.c b/src/mywindow.c
index 071a3e9ff..841bca95e 100644
--- a/src/mywindow.c
+++ b/src/mywindow.c
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2003 Olivier Fourdan
+ xfwm4 - (c) 2003 Olivier Fourdan
*/
@@ -29,7 +29,6 @@
#include <glib.h>
#include <libxfce4util/libxfce4util.h>
#include "mywindow.h"
-#include "main.h"
void
myWindowCreate (Display * dpy, Window parent, myWindow * win, Cursor cursor)
@@ -40,7 +39,7 @@ myWindowCreate (Display * dpy, Window parent, myWindow * win, Cursor cursor)
TRACE ("Created XID 0x%lx", win->window);
if (cursor != None)
{
- XDefineCursor (dpy, win->window, cursor);
+ XDefineCursor (dpy, win->window, cursor);
}
win->map = FALSE;
win->dpy = dpy;
@@ -57,8 +56,8 @@ myWindowDelete (myWindow * win)
if (win->window != None)
{
- XDestroyWindow (win->dpy, win->window);
- win->window = None;
+ XDestroyWindow (win->dpy, win->window);
+ win->window = None;
}
win->map = FALSE;
}
@@ -71,49 +70,49 @@ myWindowShow (myWindow * win, int x, int y, int width, int height,
if (!(win->window))
{
- return;
+ return;
}
if ((width < 1) || (height < 1))
{
- myWindowHide (win);
- return;
+ myWindowHide (win);
+ return;
}
if (!(win->map))
{
- XMapWindow (win->dpy, win->window);
- win->map = TRUE;
+ XMapWindow (win->dpy, win->window);
+ win->map = TRUE;
}
TRACE ("Showing XID 0x%lx", win->window);
if (((x != win->x) || (y != win->y)) && ((width != win->w)
- || (height != win->h)))
+ || (height != win->h)))
{
- XMoveResizeWindow (win->dpy, win->window, x, y, (unsigned int) width,
- (unsigned int) height);
- win->x = x;
- win->y = y;
- win->w = width;
- win->h = height;
+ XMoveResizeWindow (win->dpy, win->window, x, y, (unsigned int) width,
+ (unsigned int) height);
+ win->x = x;
+ win->y = y;
+ win->w = width;
+ win->h = height;
}
else if ((x != win->x) || (y != win->y))
{
- XMoveWindow (win->dpy, win->window, x, y);
- if (refresh)
- {
- XClearWindow (win->dpy, win->window);
- }
- win->x = x;
- win->y = y;
+ XMoveWindow (win->dpy, win->window, x, y);
+ if (refresh)
+ {
+ XClearWindow (win->dpy, win->window);
+ }
+ win->x = x;
+ win->y = y;
}
else if ((width != win->w) || (height != win->h))
{
- XResizeWindow (win->dpy, win->window, (unsigned int) width,
- (unsigned int) height);
- win->w = width;
- win->h = height;
+ XResizeWindow (win->dpy, win->window, (unsigned int) width,
+ (unsigned int) height);
+ win->w = width;
+ win->h = height;
}
else if (refresh)
{
- XClearWindow (win->dpy, win->window);
+ XClearWindow (win->dpy, win->window);
}
}
@@ -124,7 +123,7 @@ myWindowHide (myWindow * win)
if (win->map)
{
- XUnmapWindow (win->dpy, win->window);
- win->map = FALSE;
+ XUnmapWindow (win->dpy, win->window);
+ win->map = FALSE;
}
}
diff --git a/src/mywindow.h b/src/mywindow.h
index 21e7271c7..6baa7a3d3 100644
--- a/src/mywindow.h
+++ b/src/mywindow.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
diff --git a/src/netwm.c b/src/netwm.c
index 7cf43825e..0539f866a 100644
--- a/src/netwm.c
+++ b/src/netwm.c
@@ -113,13 +113,13 @@ clientSetNetState (Client * c)
TRACE ("clientSetNetState : hidden");
data[i++] = net_wm_state_hidden;
}
- XChangeProperty (dpy, c->window, net_wm_state, XA_ATOM, 32,
+ XChangeProperty (md->dpy, c->window, net_wm_state, XA_ATOM, 32,
PropModeReplace, (unsigned char *) data, i);
/*
We also set GNOME hint here for consistency and convenience,
although the meaning of net_wm_state and win_state aren't the same.
*/
- setHint (dpy, c->window, win_state, c->win_state);
+ setHint (md->dpy, c->window, win_state, c->win_state);
}
void
@@ -132,7 +132,7 @@ clientGetNetState (Client * c)
TRACE ("entering clientGetNetState");
TRACE ("client \"%s\" (0x%lx)", c->name, c->window);
- if (getAtomList (dpy, c->window, net_wm_state, &atoms, &n_atoms))
+ if (getAtomList (md->dpy, c->window, net_wm_state, &atoms, &n_atoms))
{
int i;
TRACE ("clientGetNetState: %i atoms detected", n_atoms);
@@ -510,8 +510,8 @@ clientUpdateFullscreenState (Client * c)
cx = frameX (c) + (frameWidth (c) / 2);
cy = frameY (c) + (frameHeight (c) / 2);
- monitor_nbr = gdk_screen_get_monitor_at_point (gscr, cx, cy);
- gdk_screen_get_monitor_geometry (gscr, monitor_nbr, &rect);
+ monitor_nbr = gdk_screen_get_monitor_at_point (md->gscr, cx, cy);
+ gdk_screen_get_monitor_geometry (md->gscr, monitor_nbr, &rect);
c->fullscreen_old_x = c->x;
c->fullscreen_old_y = c->y;
@@ -542,10 +542,10 @@ clientUpdateFullscreenState (Client * c)
grab focus in focus follow mouse mode. Grab the pointer to
avoid these effects
*/
- XGrabPointer (dpy, gnome_win, FALSE, EnterWindowMask, GrabModeAsync,
+ XGrabPointer (md->dpy, md->gnome_win, FALSE, EnterWindowMask, GrabModeAsync,
GrabModeAsync, None, None, GDK_CURRENT_TIME);
clientConfigure (c, &wc, CWX | CWY | CWWidth | CWHeight, NO_CFG_FLAG);
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
}
else
{
@@ -571,7 +571,7 @@ clientGetNetWmType (Client * c)
n_atoms = 0;
atoms = NULL;
- if (!getAtomList (dpy, c->window, net_wm_window_type, &atoms, &n_atoms))
+ if (!getAtomList (md->dpy, c->window, net_wm_window_type, &atoms, &n_atoms))
{
switch (c->win_layer)
{
@@ -644,9 +644,9 @@ clientGetInitialNetWmDesktop (Client * c)
CLIENT_FLAG_SESSION_MANAGED | CLIENT_FLAG_WORKSPACE_SET))
{
FLAG_SET (c->flags, CLIENT_FLAG_WORKSPACE_SET);
- c->win_workspace = workspace;
+ c->win_workspace = md->current_ws;
}
- if (getHint (dpy, c->window, net_wm_desktop, &val))
+ if (getHint (md->dpy, c->window, net_wm_desktop, &val))
{
TRACE ("atom net_wm_desktop detected");
if (val == (int) ALL_WORKSPACES)
@@ -660,7 +660,7 @@ clientGetInitialNetWmDesktop (Client * c)
FLAG_SET (c->flags, CLIENT_FLAG_STICKY);
c->win_state |= WIN_STATE_STICKY;
}
- c->win_workspace = workspace;
+ c->win_workspace = md->current_ws;
}
else
{
@@ -671,7 +671,7 @@ clientGetInitialNetWmDesktop (Client * c)
}
FLAG_SET (c->flags, CLIENT_FLAG_WORKSPACE_SET);
}
- else if (getHint (dpy, c->window, win_workspace, &val))
+ else if (getHint (md->dpy, c->window, win_workspace, &val))
{
TRACE ("atom win_workspace specifies window \"%s\" is on desk %i",
c->name, (int) val);
@@ -690,15 +690,15 @@ clientGetInitialNetWmDesktop (Client * c)
}
TRACE ("initial desktop for window \"%s\" is %i", c->name,
c->win_workspace);
- setHint (dpy, c->window, win_workspace, c->win_workspace);
+ setHint (md->dpy, c->window, win_workspace, c->win_workspace);
if (FLAG_TEST (c->flags, CLIENT_FLAG_STICKY))
{
- setHint (dpy, c->window, net_wm_desktop,
+ setHint (md->dpy, c->window, net_wm_desktop,
(unsigned long) ALL_WORKSPACES);
}
else
{
- setHint (dpy, c->window, net_wm_desktop,
+ setHint (md->dpy, c->window, net_wm_desktop,
(unsigned long) c->win_workspace);
}
}
@@ -716,7 +716,7 @@ clientSetNetClientList (Atom a, GList * list)
size = g_list_length (list);
if (size < 1)
{
- XDeleteProperty (dpy, root, a);
+ XDeleteProperty (md->dpy, md->xroot, a);
}
else if ((listw = (Window *) malloc ((size + 1) * sizeof (Window))))
{
@@ -727,7 +727,7 @@ clientSetNetClientList (Atom a, GList * list)
Client *c = (Client *) index_src->data;
*index_dest = c->window;
}
- XChangeProperty (dpy, root, a, XA_WINDOW, 32, PropModeReplace,
+ XChangeProperty (md->dpy, md->xroot, a, XA_WINDOW, 32, PropModeReplace,
(unsigned char *) listw, size);
free (listw);
}
@@ -751,7 +751,7 @@ clientGetNetStruts (Client * c)
FLAG_UNSET (c->flags, CLIENT_FLAG_HAS_STRUT);
FLAG_UNSET (c->flags, CLIENT_FLAG_HAS_STRUT_PARTIAL);
- if (getCardinalList (dpy, c->window, net_wm_strut_partial, &struts, &nitems))
+ if (getCardinalList (md->dpy, c->window, net_wm_strut_partial, &struts, &nitems))
{
if (nitems != 12)
{
@@ -767,9 +767,9 @@ clientGetNetStruts (Client * c)
}
XFree (struts);
- workspaceUpdateArea (margins, gnome_margins);
+ workspaceUpdateArea (md->margins, md->gnome_margins);
}
- else if (getCardinalList (dpy, c->window, net_wm_strut, &struts, &nitems))
+ else if (getCardinalList (md->dpy, c->window, net_wm_strut, &struts, &nitems))
{
if (nitems != 4)
{
@@ -789,13 +789,13 @@ clientGetNetStruts (Client * c)
/* Fill(in values as for partial struts */
c->struts[TOP_START_X] = c->struts[BOTTOM_START_X] = 0;
c->struts[TOP_END_X] = c->struts[BOTTOM_END_X] =
- gdk_screen_get_width (gscr);
+ gdk_screen_get_width (md->gscr);
c->struts[LEFT_START_Y] = c->struts[RIGHT_START_Y] = 0;
c->struts[LEFT_END_Y] = c->struts[RIGHT_END_Y] =
- gdk_screen_get_height (gscr);
+ gdk_screen_get_height (md->gscr);
XFree (struts);
- workspaceUpdateArea (margins, gnome_margins);
+ workspaceUpdateArea (md->margins, md->gnome_margins);
}
}
@@ -820,7 +820,7 @@ clientSetNetActions (Client * c)
{
atoms[i++] = net_wm_action_shade;
}
- XChangeProperty (dpy, c->window, net_wm_allowed_actions, XA_ATOM, 32,
+ XChangeProperty (md->dpy, c->window, net_wm_allowed_actions, XA_ATOM, 32,
PropModeReplace, (unsigned char *) atoms, i);
}
diff --git a/src/netwm.h b/src/netwm.h
index 67f5f8d50..3b3233d10 100644
--- a/src/netwm.h
+++ b/src/netwm.h
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
@@ -29,17 +29,17 @@
#include <glib.h>
#include "client.h"
-void clientSetNetState (Client *);
-void clientGetNetState (Client *);
-void clientUpdateNetState (Client *, XClientMessageEvent *);
+void clientSetNetState (Client *);
+void clientGetNetState (Client *);
+void clientUpdateNetState (Client *, XClientMessageEvent *);
void clientUpdateFullscreenState (Client *);
-void clientGetNetWmType (Client *);
-void clientGetInitialNetWmDesktop (Client *);
-void clientSetNetClientList (Atom, GList *);
-void clientGetNetStruts (Client *);
-void clientSetNetActions (Client *);
-void clientWindowType (Client *);
-void clientUpdateAboveState (Client *);
-void clientUpdateBelowState (Client *);
+void clientGetNetWmType (Client *);
+void clientGetInitialNetWmDesktop (Client *);
+void clientSetNetClientList (Atom, GList *);
+void clientGetNetStruts (Client *);
+void clientSetNetActions (Client *);
+void clientWindowType (Client *);
+void clientUpdateAboveState (Client *);
+void clientUpdateBelowState (Client *);
#endif /* INC_NETWM_H */
diff --git a/src/parserc.c b/src/parserc.c
index 5f433eaaa..9b8a7d781 100644
--- a/src/parserc.c
+++ b/src/parserc.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -49,11 +49,11 @@ parseRc (const gchar * file, const gchar * dir, Settings rc[])
if (dir)
{
- filename = g_build_filename (dir, G_DIR_SEPARATOR_S, file, NULL);
+ filename = g_build_filename (dir, G_DIR_SEPARATOR_S, file, NULL);
}
else
{
- filename = g_strdup (file);
+ filename = g_strdup (file);
}
fp = fopen (filename, "r");
@@ -61,16 +61,16 @@ parseRc (const gchar * file, const gchar * dir, Settings rc[])
if (!fp)
{
- return FALSE;
+ return FALSE;
}
while (fgets (buf, sizeof (buf), fp))
{
- lvalue = strtok (buf, "=");
- rvalue = strtok (NULL, "\n");
- if ((lvalue) && (rvalue))
- {
- setValue (lvalue, rvalue, rc);
- }
+ lvalue = strtok (buf, "=");
+ rvalue = strtok (NULL, "\n");
+ if ((lvalue) && (rvalue))
+ {
+ setValue (lvalue, rvalue, rc);
+ }
}
fclose (fp);
return TRUE;
@@ -86,11 +86,11 @@ checkRc (Settings rc[])
for (i = 0; rc[i].option; i++)
{
- if (rc[i].required && !rc[i].value)
- {
- fprintf (stderr, "missing value for option %s\n", rc[i].option);
- rval = FALSE;
- }
+ if (rc[i].required && !rc[i].value)
+ {
+ fprintf (stderr, "missing value for option %s\n", rc[i].option);
+ rval = FALSE;
+ }
}
return rval;
}
@@ -106,10 +106,10 @@ getValue (const gchar * option, Settings rc[])
for (i = 0; rc[i].option; i++)
{
- if (!g_ascii_strcasecmp (option, rc[i].option))
- {
- return rc[i].value;
- }
+ if (!g_ascii_strcasecmp (option, rc[i].option))
+ {
+ return rc[i].value;
+ }
}
return NULL;
}
@@ -126,19 +126,19 @@ setValue (const gchar * lvalue, const gchar * rvalue, Settings rc[])
for (i = 0; rc[i].option; i++)
{
- if (!g_ascii_strcasecmp (lvalue, rc[i].option))
- {
- if (rvalue)
- {
- if (rc[i].value)
- {
- g_free (rc[i].value);
- }
- rc[i].value = g_strdup (rvalue);
- TRACE ("%s=%s", rc[i].option, rc[i].value);
- return TRUE;
- }
- }
+ if (!g_ascii_strcasecmp (lvalue, rc[i].option))
+ {
+ if (rvalue)
+ {
+ if (rc[i].value)
+ {
+ g_free (rc[i].value);
+ }
+ rc[i].value = g_strdup (rvalue);
+ TRACE ("%s=%s", rc[i].option, rc[i].value);
+ return TRUE;
+ }
+ }
}
return FALSE;
}
@@ -167,111 +167,111 @@ getThemeDir (const gchar * theme, const gchar * file)
{
if (!theme)
{
- return g_build_filename (DATADIR, G_DIR_SEPARATOR_S, "themes",
- G_DIR_SEPARATOR_S, DEFAULT_THEME, NULL);
+ return g_build_filename (DATADIR, G_DIR_SEPARATOR_S, "themes",
+ G_DIR_SEPARATOR_S, DEFAULT_THEME, NULL);
}
else if (g_path_is_absolute (theme))
{
- if (g_file_test (theme, G_FILE_TEST_IS_DIR))
- {
- return g_strdup (theme);
- }
- else
- {
- return g_build_filename (DATADIR, G_DIR_SEPARATOR_S, "themes",
- G_DIR_SEPARATOR_S, DEFAULT_THEME, NULL);
- }
+ if (g_file_test (theme, G_FILE_TEST_IS_DIR))
+ {
+ return g_strdup (theme);
+ }
+ else
+ {
+ return g_build_filename (DATADIR, G_DIR_SEPARATOR_S, "themes",
+ G_DIR_SEPARATOR_S, DEFAULT_THEME, NULL);
+ }
}
else
{
- /* First try, $HOME/.themes/<theme_name>/xfwm4/ */
-
- gchar *test_dir = g_build_filename (g_get_home_dir (),
- G_DIR_SEPARATOR_S, ".themes",
- G_DIR_SEPARATOR_S, theme,
- G_DIR_SEPARATOR_S, "xfwm4",
- NULL);
-
- gchar *test_file = g_build_filename (test_dir,
- G_DIR_SEPARATOR_S, file,
- NULL);
+ /* First try, $HOME/.themes/<theme_name>/xfwm4/ */
+
+ gchar *test_dir = g_build_filename (g_get_home_dir (),
+ G_DIR_SEPARATOR_S, ".themes",
+ G_DIR_SEPARATOR_S, theme,
+ G_DIR_SEPARATOR_S, "xfwm4",
+ NULL);
+
+ gchar *test_file = g_build_filename (test_dir,
+ G_DIR_SEPARATOR_S, file,
+ NULL);
- if (g_file_test (test_file, G_FILE_TEST_IS_REGULAR))
- {
- g_free (test_file);
- return test_dir;
- }
+ if (g_file_test (test_file, G_FILE_TEST_IS_REGULAR))
+ {
+ g_free (test_file);
+ return test_dir;
+ }
#if 0
- /* Second try, $HOME/.themes/xfwm4/<theme_name>/ */
- g_free (test_file);
- g_free (test_dir);
-
- test_dir = g_build_filename (g_get_home_dir (),
- G_DIR_SEPARATOR_S, ".themes",
- G_DIR_SEPARATOR_S, "xfwm4",
- G_DIR_SEPARATOR_S, theme,
- NULL);
-
- test_file = g_build_filename (test_dir,
- G_DIR_SEPARATOR_S, file,
- NULL);
+ /* Second try, $HOME/.themes/xfwm4/<theme_name>/ */
+ g_free (test_file);
+ g_free (test_dir);
+
+ test_dir = g_build_filename (g_get_home_dir (),
+ G_DIR_SEPARATOR_S, ".themes",
+ G_DIR_SEPARATOR_S, "xfwm4",
+ G_DIR_SEPARATOR_S, theme,
+ NULL);
+
+ test_file = g_build_filename (test_dir,
+ G_DIR_SEPARATOR_S, file,
+ NULL);
- if (g_file_test (test_file, G_FILE_TEST_IS_REGULAR))
- {
- g_free (test_file);
- return test_dir;
- }
+ if (g_file_test (test_file, G_FILE_TEST_IS_REGULAR))
+ {
+ g_free (test_file);
+ return test_dir;
+ }
#endif
- /* Third try, /usr/share/themes/<theme_name>/xfwm4/ */
- g_free (test_file);
- g_free (test_dir);
-
- test_dir = g_build_filename (DATADIR,
- G_DIR_SEPARATOR_S, "themes",
- G_DIR_SEPARATOR_S, theme,
- G_DIR_SEPARATOR_S, "xfwm4",
- NULL);
-
- test_file = g_build_filename (test_dir,
- G_DIR_SEPARATOR_S, file,
- NULL);
+ /* Third try, /usr/share/themes/<theme_name>/xfwm4/ */
+ g_free (test_file);
+ g_free (test_dir);
+
+ test_dir = g_build_filename (DATADIR,
+ G_DIR_SEPARATOR_S, "themes",
+ G_DIR_SEPARATOR_S, theme,
+ G_DIR_SEPARATOR_S, "xfwm4",
+ NULL);
+
+ test_file = g_build_filename (test_dir,
+ G_DIR_SEPARATOR_S, file,
+ NULL);
- if (g_file_test (test_file, G_FILE_TEST_IS_REGULAR))
- {
- g_free (test_file);
- return test_dir;
- }
+ if (g_file_test (test_file, G_FILE_TEST_IS_REGULAR))
+ {
+ g_free (test_file);
+ return test_dir;
+ }
#if 0
- /* Fourth try, /usr/share/themes/xfwm4/<theme_name>/ */
- g_free (test_file);
- g_free (test_dir);
-
- test_dir = g_build_filename (DATADIR,
- G_DIR_SEPARATOR_S, "themes",
- G_DIR_SEPARATOR_S, theme,
- NULL);
-
- test_file = g_build_filename (test_dir,
- G_DIR_SEPARATOR_S, file,
- NULL);
+ /* Fourth try, /usr/share/themes/xfwm4/<theme_name>/ */
+ g_free (test_file);
+ g_free (test_dir);
+
+ test_dir = g_build_filename (DATADIR,
+ G_DIR_SEPARATOR_S, "themes",
+ G_DIR_SEPARATOR_S, theme,
+ NULL);
+
+ test_file = g_build_filename (test_dir,
+ G_DIR_SEPARATOR_S, file,
+ NULL);
- if (g_file_test (test_file, G_FILE_TEST_IS_REGULAR))
- {
- g_free (test_file);
- return test_dir;
- }
+ if (g_file_test (test_file, G_FILE_TEST_IS_REGULAR))
+ {
+ g_free (test_file);
+ return test_dir;
+ }
#endif
-
- /* Pfew, really can't find that theme nowhere! */
- g_free (test_file);
- g_free (test_dir);
+
+ /* Pfew, really can't find that theme nowhere! */
+ g_free (test_file);
+ g_free (test_dir);
}
return g_build_filename (DATADIR, G_DIR_SEPARATOR_S, "themes",
- G_DIR_SEPARATOR_S, DEFAULT_THEME, NULL);
+ G_DIR_SEPARATOR_S, DEFAULT_THEME, NULL);
}
void
@@ -283,10 +283,10 @@ freeRc (Settings rc[])
for (i = 0; rc[i].option; i++)
{
- if (rc[i].value)
- {
- g_free (rc[i].value);
- rc[i].value = NULL;
- }
+ if (rc[i].value)
+ {
+ g_free (rc[i].value);
+ rc[i].value = NULL;
+ }
}
}
diff --git a/src/parserc.h b/src/parserc.h
index c0f742533..0f948cffe 100644
--- a/src/parserc.h
+++ b/src/parserc.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
diff --git a/src/placement.c b/src/placement.c
index 7c032d65c..cbdd0974d 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -52,18 +52,18 @@ clientStrutAreaOverlap (int x, int y, int w, int h, Client * c)
c->struts[LEFT],
c->struts[LEFT_END_Y])
+ overlap (x, y, x + w, y + h,
- gdk_screen_get_width (gscr) - c->struts[RIGHT],
+ gdk_screen_get_width (md->gscr) - c->struts[RIGHT],
c->struts[RIGHT_START_Y],
- gdk_screen_get_width (gscr), c->struts[RIGHT_END_Y])
+ gdk_screen_get_width (md->gscr), c->struts[RIGHT_END_Y])
+ overlap (x, y, x + w, y + h,
c->struts[TOP_START_X], 0,
c->struts[TOP_END_X],
c->struts[TOP])
+ overlap (x, y, x + w, y + h,
c->struts[BOTTOM_START_X],
- gdk_screen_get_height (gscr) - c->struts[BOTTOM],
+ gdk_screen_get_height (md->gscr) - c->struts[BOTTOM],
c->struts[BOTTOM_END_X],
- gdk_screen_get_height (gscr));
+ gdk_screen_get_height (md->gscr));
}
return sigma;
}
@@ -139,10 +139,10 @@ clientMaxSpace (int *x, int *y, int *w, int *h)
/* Right */
if (overlap (*x, *y, *x + *w, *y + *h,
- gdk_screen_get_width (gscr) - c2->struts[RIGHT], c2->struts[RIGHT_START_Y],
- gdk_screen_get_width (gscr), c2->struts[RIGHT_END_Y]))
+ gdk_screen_get_width (md->gscr) - c2->struts[RIGHT], c2->struts[RIGHT_START_Y],
+ gdk_screen_get_width (md->gscr), c2->struts[RIGHT_END_Y]))
{
- delta = (*x + *w) - gdk_screen_get_width (gscr) + c2->struts[RIGHT];
+ delta = (*x + *w) - gdk_screen_get_width (md->gscr) + c2->struts[RIGHT];
*w = *w - delta;
}
@@ -157,10 +157,10 @@ clientMaxSpace (int *x, int *y, int *w, int *h)
/* Bottom */
if (overlap (*x, *y, *x + *w, *y + *h,
- c2->struts[BOTTOM_START_X], gdk_screen_get_height (gscr) - c2->struts[BOTTOM],
- c2->struts[BOTTOM_END_X], gdk_screen_get_height (gscr)))
+ c2->struts[BOTTOM_START_X], gdk_screen_get_height (md->gscr) - c2->struts[BOTTOM],
+ c2->struts[BOTTOM_END_X], gdk_screen_get_height (md->gscr)))
{
- delta = (*y + *h) - gdk_screen_get_height (gscr) + c2->struts[BOTTOM];
+ delta = (*y + *h) - gdk_screen_get_height (md->gscr) + c2->struts[BOTTOM];
*h = *h - delta;
}
}
@@ -217,8 +217,8 @@ clientConstrainPos (Client * c, gboolean show_full)
cx = frame_x + (frame_width / 2);
cy = frame_y + (frame_height / 2);
- monitor_nbr = gdk_screen_get_monitor_at_point (gscr, cx, cy);
- gdk_screen_get_monitor_geometry (gscr, monitor_nbr, &rect);
+ monitor_nbr = gdk_screen_get_monitor_at_point (md->gscr, cx, cy);
+ gdk_screen_get_monitor_geometry (md->gscr, monitor_nbr, &rect);
disp_x = rect.x;
disp_y = rect.y;
@@ -250,54 +250,54 @@ clientConstrainPos (Client * c, gboolean show_full)
c->y = disp_y + frame_top;
}
- /* Struts and other partial struts */
- for (c2 = clients, i = 0; i < client_count; c2 = c2->next, i++)
- {
+ /* Struts and other partial struts */
+ for (c2 = clients, i = 0; i < client_count; c2 = c2->next, i++)
+ {
if (FLAG_TEST_ALL (c2->flags, CLIENT_FLAG_HAS_STRUT | CLIENT_FLAG_VISIBLE) && (c2 != c))
{
- /* Left */
- if (overlapY (frame_y, frame_y + frame_height, c2->struts[LEFT_START_Y], c2->struts[LEFT_END_Y]))
- {
- if (overlapX (frame_x, frame_x + frame_width, 0, c2->struts[LEFT]))
+ /* Left */
+ if (overlapY (frame_y, frame_y + frame_height, c2->struts[LEFT_START_Y], c2->struts[LEFT_END_Y]))
+ {
+ if (overlapX (frame_x, frame_x + frame_width, 0, c2->struts[LEFT]))
{
- c->x = c2->struts[LEFT] + frame_left;
- frame_x = frameX (c);
+ c->x = c2->struts[LEFT] + frame_left;
+ frame_x = frameX (c);
}
- }
+ }
- /* Right */
- if (overlapY (frame_y, frame_y + frame_height, c2->struts[RIGHT_START_Y], c2->struts[RIGHT_END_Y]))
- {
- if (overlapX (frame_x, frame_x + frame_width,
- gdk_screen_get_width (gscr) - c2->struts[RIGHT], gdk_screen_get_width (gscr)))
+ /* Right */
+ if (overlapY (frame_y, frame_y + frame_height, c2->struts[RIGHT_START_Y], c2->struts[RIGHT_END_Y]))
+ {
+ if (overlapX (frame_x, frame_x + frame_width,
+ gdk_screen_get_width (md->gscr) - c2->struts[RIGHT], gdk_screen_get_width (md->gscr)))
{
- c->x = gdk_screen_get_width (gscr) - c2->struts[RIGHT] - frame_width;
- frame_x = frameX (c);
+ c->x = gdk_screen_get_width (md->gscr) - c2->struts[RIGHT] - frame_width;
+ frame_x = frameX (c);
}
- }
+ }
- /* Top */
- if (overlapX (frame_x, frame_x + frame_width, c2->struts[TOP_START_X], c2->struts[TOP_END_X]))
- {
+ /* Top */
+ if (overlapX (frame_x, frame_x + frame_width, c2->struts[TOP_START_X], c2->struts[TOP_END_X]))
+ {
if (overlapY (frame_y, frame_y + frame_height, 0, c2->struts[TOP]))
{
- c->y = c2->struts[TOP] + frame_top;
- frame_y = frameY (c);
+ c->y = c2->struts[TOP] + frame_top;
+ frame_y = frameY (c);
}
- }
+ }
- /* Bottom */
- if (overlapX (frame_x, frame_x + frame_width, c2->struts[BOTTOM_START_X], c2->struts[BOTTOM_END_X]))
- {
+ /* Bottom */
+ if (overlapX (frame_x, frame_x + frame_width, c2->struts[BOTTOM_START_X], c2->struts[BOTTOM_END_X]))
+ {
if (overlapY (frame_y, frame_y + frame_height,
- gdk_screen_get_height (gscr) - c2->struts[BOTTOM], gdk_screen_get_height (gscr)))
+ gdk_screen_get_height (md->gscr) - c2->struts[BOTTOM], gdk_screen_get_height (md->gscr)))
{
- c->y = gdk_screen_get_height (gscr) - c2->struts[BOTTOM] - frame_height;
- frame_y = frameY (c);
+ c->y = gdk_screen_get_height (md->gscr) - c2->struts[BOTTOM] - frame_height;
+ frame_y = frameY (c);
}
- }
+ }
}
- }
+ }
}
else
{
@@ -327,57 +327,57 @@ clientConstrainPos (Client * c, gboolean show_full)
frame_y = frameY (c);
}
- /* Struts and other partial struts */
- for (c2 = clients, i = 0; i < client_count; c2 = c2->next, i++)
- {
+ /* Struts and other partial struts */
+ for (c2 = clients, i = 0; i < client_count; c2 = c2->next, i++)
+ {
if (FLAG_TEST_ALL (c2->flags, CLIENT_FLAG_HAS_STRUT | CLIENT_FLAG_VISIBLE) && (c2 != c))
{
- /* Left */
- if (overlapY (frame_y, frame_y + frame_height, c2->struts[LEFT_START_Y], c2->struts[LEFT_END_Y]))
- {
+ /* Left */
+ if (overlapY (frame_y, frame_y + frame_height, c2->struts[LEFT_START_Y], c2->struts[LEFT_END_Y]))
+ {
if (frame_x + frame_width < c2->struts[LEFT] + CLIENT_MIN_VISIBLE)
{
- c->x = c2->struts[LEFT] + CLIENT_MIN_VISIBLE - frame_width + frame_left;
- frame_x = frameX (c);
+ c->x = c2->struts[LEFT] + CLIENT_MIN_VISIBLE - frame_width + frame_left;
+ frame_x = frameX (c);
}
- }
+ }
- /* Right */
- if (overlapY (frame_y, frame_y + frame_height, c2->struts[RIGHT_START_Y], c2->struts[RIGHT_END_Y]))
- {
- if (frame_x > gdk_screen_get_width (gscr) - c2->struts[RIGHT] - CLIENT_MIN_VISIBLE)
+ /* Right */
+ if (overlapY (frame_y, frame_y + frame_height, c2->struts[RIGHT_START_Y], c2->struts[RIGHT_END_Y]))
+ {
+ if (frame_x > gdk_screen_get_width (md->gscr) - c2->struts[RIGHT] - CLIENT_MIN_VISIBLE)
{
- c->x = gdk_screen_get_width (gscr) - c2->struts[RIGHT] - CLIENT_MIN_VISIBLE + frame_left;
- frame_x = frameX (c);
+ c->x = gdk_screen_get_width (md->gscr) - c2->struts[RIGHT] - CLIENT_MIN_VISIBLE + frame_left;
+ frame_x = frameX (c);
}
- }
+ }
- /* Top */
- if (overlapX (frame_x, frame_x + frame_width, c2->struts[TOP_START_X], c2->struts[TOP_END_X]))
- {
+ /* Top */
+ if (overlapX (frame_x, frame_x + frame_width, c2->struts[TOP_START_X], c2->struts[TOP_END_X]))
+ {
if (overlapY (frame_y, frame_y + frame_top, 0, c2->struts[TOP]))
{
- c->y = c2->struts[TOP] + frame_top;
- frame_y = frameY (c);
+ c->y = c2->struts[TOP] + frame_top;
+ frame_y = frameY (c);
}
if (frame_y + frame_height < c2->struts[TOP] + CLIENT_MIN_VISIBLE)
{
- c->y = c2->struts[TOP] + CLIENT_MIN_VISIBLE - frame_height + frame_top;
- frame_y = frameY (c);
+ c->y = c2->struts[TOP] + CLIENT_MIN_VISIBLE - frame_height + frame_top;
+ frame_y = frameY (c);
}
- }
+ }
- /* Bottom */
- if (overlapX (frame_x, frame_x + frame_width, c2->struts[BOTTOM_START_X], c2->struts[BOTTOM_END_X]))
- {
- if (frame_y > gdk_screen_get_height (gscr) - c2->struts[BOTTOM] - CLIENT_MIN_VISIBLE)
+ /* Bottom */
+ if (overlapX (frame_x, frame_x + frame_width, c2->struts[BOTTOM_START_X], c2->struts[BOTTOM_END_X]))
+ {
+ if (frame_y > gdk_screen_get_height (md->gscr) - c2->struts[BOTTOM] - CLIENT_MIN_VISIBLE)
{
- c->y = gdk_screen_get_height (gscr) - c2->struts[BOTTOM] - CLIENT_MIN_VISIBLE + frame_top;
- frame_y = frameY (c);
+ c->y = gdk_screen_get_height (md->gscr) - c2->struts[BOTTOM] - CLIENT_MIN_VISIBLE + frame_top;
+ frame_y = frameY (c);
}
- }
+ }
}
- }
+ }
}
}
@@ -401,10 +401,10 @@ clientKeepVisible (Client * c)
/* Translate coodinates to center on physical screen */
- diff_x = abs (c->size->x - ((gdk_screen_get_width (gscr) - c->width) / 2));
- diff_y = abs (c->size->y - ((gdk_screen_get_height (gscr) - c->height) / 2));
+ diff_x = abs (c->size->x - ((gdk_screen_get_width (md->gscr) - c->width) / 2));
+ diff_y = abs (c->size->y - ((gdk_screen_get_height (md->gscr) - c->height) / 2));
- if (((gdk_screen_get_n_monitors (gscr) > 1) && (diff_x < 25) && (diff_y < 25)) ||
+ if (((gdk_screen_get_n_monitors (md->gscr) > 1) && (diff_x < 25) && (diff_y < 25)) ||
((frameX (c) == 0) && (frameY (c) == 0) && (c->type & (WINDOW_TYPE_DIALOG)) && !clientIsTransient (c)))
{
GdkRectangle rect;
@@ -414,10 +414,10 @@ clientKeepVisible (Client * c)
* Thus, will move it so its center on the current
* physical screen
*/
- getMouseXY (root, &cx, &cy);
+ getMouseXY (md->xroot, &cx, &cy);
- monitor_nbr = gdk_screen_get_monitor_at_point (gscr, cx, cy);
- gdk_screen_get_monitor_geometry (gscr, monitor_nbr, &rect);
+ monitor_nbr = gdk_screen_get_monitor_at_point (md->gscr, cx, cy);
+ gdk_screen_get_monitor_geometry (md->gscr, monitor_nbr, &rect);
c->x = rect.x + (rect.width - c->width) / 2;
c->y = rect.y + (rect.height - c->height) / 2;
@@ -466,10 +466,10 @@ clientInitPosition (Client * c)
return;
}
- getMouseXY (root, &msx, &msy);
+ getMouseXY (md->xroot, &msx, &msy);
- monitor_nbr = gdk_screen_get_monitor_at_point (gscr, msx, msy);
- gdk_screen_get_monitor_geometry (gscr, monitor_nbr, &rect);
+ monitor_nbr = gdk_screen_get_monitor_at_point (md->gscr, msx, msy);
+ gdk_screen_get_monitor_geometry (md->gscr, monitor_nbr, &rect);
frame_x = frameX (c);
frame_y = frameY (c);
@@ -480,9 +480,9 @@ clientInitPosition (Client * c)
full_x = MAX (params.xfwm_margins[LEFT], rect.x);
full_y = MAX (params.xfwm_margins[TOP], rect.y);
- full_w = MIN (gdk_screen_get_width (gscr) - params.xfwm_margins[RIGHT],
+ full_w = MIN (gdk_screen_get_width (md->gscr) - params.xfwm_margins[RIGHT],
rect.x + rect.width) - full_x;
- full_h = MIN (gdk_screen_get_height (gscr) - params.xfwm_margins[BOTTOM],
+ full_h = MIN (gdk_screen_get_height (md->gscr) - params.xfwm_margins[BOTTOM],
rect.y + rect.height) - full_y;
/* Adjust size to the widest size available, not covering struts */
diff --git a/src/placement.h b/src/placement.h
index 3df0f226c..c14c4d4cc 100644
--- a/src/placement.h
+++ b/src/placement.h
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
@@ -30,8 +30,8 @@
void clientMaxSpace (int *, int *, int *, int *h);
gboolean clientCkeckTitle (Client *);
-void clientConstrainPos (Client *, gboolean);
-void clientKeepVisible (Client *);
-void clientInitPosition (Client *);
+void clientConstrainPos (Client *, gboolean);
+void clientKeepVisible (Client *);
+void clientInitPosition (Client *);
#endif /* INC_PLACEMENT_H */
diff --git a/src/poswin.c b/src/poswin.c
index b4ef7efec..1cdb99482 100644
--- a/src/poswin.c
+++ b/src/poswin.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2004 Olivier Fourdan
- based on a patch from Joshua Blanton <jblanton@irg.cs.ohiou.edu>
+ xfwm4 - (c) 2004 Olivier Fourdan
+ based on a patch from Joshua Blanton <jblanton@irg.cs.ohiou.edu>
*/
#ifdef HAVE_CONFIG_H
@@ -90,11 +90,11 @@ poswinSetPosition (Poswin * poswin, Client *c)
py = y + (frameHeight (c) - ph) / 2;
if (GTK_WIDGET_REALIZED (poswin->window))
{
- gdk_window_move_resize (poswin->window->window, px, py, pw, ph);
+ gdk_window_move_resize (poswin->window->window, px, py, pw, ph);
}
else
{
- gtk_window_move (GTK_WINDOW (poswin->window), px, py);
+ gtk_window_move (GTK_WINDOW (poswin->window), px, py);
}
}
diff --git a/src/poswin.h b/src/poswin.h
index 19e6093ce..d85fc398c 100644
--- a/src/poswin.h
+++ b/src/poswin.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2004 Olivier Fourdan
- based on a patch from Joshua Blanton <jblanton@irg.cs.ohiou.edu>
+ xfwm4 - (c) 2004 Olivier Fourdan
+ based on a patch from Joshua Blanton <jblanton@irg.cs.ohiou.edu>
*/
#ifdef HAVE_CONFIG_H
diff --git a/src/session.c b/src/session.c
index c8e4cf505..0e54a7ec6 100644
--- a/src/session.c
+++ b/src/session.c
@@ -32,10 +32,10 @@
#include <sys/types.h>
#include <signal.h>
-#include "session.h"
#include "main.h"
#include "hints.h"
#include "client.h"
+#include "session.h"
typedef struct _match
{
@@ -73,7 +73,7 @@ my_free_string_list (gchar ** list, gint n)
if (!list || !n)
{
- return; /* silently... :) */
+ return; /* silently... :) */
}
i = 0;
@@ -81,10 +81,10 @@ my_free_string_list (gchar ** list, gint n)
while ((i < n) && (s))
{
- g_free (*s);
- *s = NULL;
- s++;
- i++;
+ g_free (*s);
+ *s = NULL;
+ s++;
+ i++;
}
}
@@ -108,15 +108,15 @@ escape_quote (gchar * s)
idx1 = s;
while (*idx1)
{
- if (*(idx1++) == '"')
- {
- nbquotes++;
- }
+ if (*(idx1++) == '"')
+ {
+ nbquotes++;
+ }
}
/* If there is no quote in the string, return it */
if (!nbquotes)
{
- return (g_strdup (s));
+ return (g_strdup (s));
}
/* Or else, allocate memory for the new string */
@@ -126,16 +126,16 @@ escape_quote (gchar * s)
idx2 = ns;
while (*idx1)
{
- if (*idx1 == '"')
- {
- *(idx2++) = '\\';
- *(idx2++) = '"';
- }
- else
- {
- *(idx2++) = *idx1;
- }
- idx1++;
+ if (*idx1 == '"')
+ {
+ *(idx2++) = '\\';
+ *(idx2++) = '"';
+ }
+ else
+ {
+ *(idx2++) = *idx1;
+ }
+ idx1++;
}
/* Add null char */
*idx2 = '\0';
@@ -164,24 +164,24 @@ unescape_quote (gchar * s)
idx2 = ns;
while (*idx1)
{
- if (*idx1 == '\\')
- {
- *(idx2++) = *idx1;
- backslash = TRUE;
- }
- else if ((*idx1 == '"') && backslash)
- {
- /* Move backward to override the "\" */
- *(--idx2) = *idx1;
- idx2++;
- backslash = FALSE;
- }
- else
- {
- *(idx2++) = *idx1;
- backslash = FALSE;
- }
- idx1++;
+ if (*idx1 == '\\')
+ {
+ *(idx2++) = *idx1;
+ backslash = TRUE;
+ }
+ else if ((*idx1 == '"') && backslash)
+ {
+ /* Move backward to override the "\" */
+ *(--idx2) = *idx1;
+ idx2++;
+ backslash = FALSE;
+ }
+ else
+ {
+ *(idx2++) = *idx1;
+ backslash = FALSE;
+ }
+ idx1++;
}
*idx2 = '\0';
return ns;
@@ -202,38 +202,38 @@ getsubstring (gchar * s, gint * length)
end = skip = s;
while ((*skip == ' ') || (*skip == '\t'))
{
- end = ++skip;
- (*length)++;
+ end = ++skip;
+ (*length)++;
}
if (*skip == '"')
{
- pbrk = '"';
- end = ++skip;
- (*length)++;
+ pbrk = '"';
+ end = ++skip;
+ (*length)++;
}
else
{
- pbrk = ' ';
+ pbrk = ' ';
}
finished = FALSE;
while ((!finished) && (*end))
{
- if (*end == '\\')
- {
- backslash = TRUE;
- }
- else if ((*end == pbrk) && backslash)
- {
- backslash = FALSE;
- }
- else if (*end == pbrk)
- {
- finished = TRUE;
- }
- end++;
- lg++;
- (*length)++;
+ if (*end == '\\')
+ {
+ backslash = TRUE;
+ }
+ else if ((*end == pbrk) && backslash)
+ {
+ backslash = FALSE;
+ }
+ else if (*end == pbrk)
+ {
+ finished = TRUE;
+ }
+ end++;
+ lg++;
+ (*length)++;
}
ns = g_new (gchar, lg + 1);
/* Skip pbrk character */
@@ -242,7 +242,7 @@ getsubstring (gchar * s, gint * length)
idx2 = ns;
do
{
- *(idx2++) = *idx1;
+ *(idx2++) = *idx1;
}
while (++idx1 < end);
*idx2 = '\0';
@@ -264,86 +264,86 @@ sessionSaveWindowStates (gchar * filename)
if ((f = fopen (filename, "w")))
{
- for (c = clients, client_idx = 0; client_idx < client_count;
- c = c->next, client_idx++)
- {
- if (c->client_leader != None)
- {
- getWindowRole (dpy, c->client_leader, &window_role);
- }
- else
- {
- window_role = NULL;
- }
-
- fprintf (f, "[CLIENT] 0x%lx\n", c->window);
-
- getClientID (dpy, c->window, &client_id);
- if (client_id)
- {
- fprintf (f, " [CLIENT_ID] %s\n", client_id);
- XFree (client_id);
- client_id = NULL;
- }
-
- if (c->client_leader)
- {
- fprintf (f, " [CLIENT_LEADER] 0x%lx\n", c->client_leader);
- }
-
- if (window_role)
- {
- fprintf (f, " [WINDOW_ROLE] %s\n", window_role);
- XFree (window_role);
- window_role = NULL;
- }
-
- if (c->class.res_class)
- {
- fprintf (f, " [RES_NAME] %s\n", c->class.res_name);
- }
-
- if (c->class.res_name)
- {
- fprintf (f, " [RES_CLASS] %s\n", c->class.res_class);
- }
-
- if (c->name)
- {
- fprintf (f, " [WM_NAME] %s\n", c->name);
- }
-
- wm_command_count = 0;
- getWindowCommand (dpy, c->window, &wm_command, &wm_command_count);
- if ((wm_command_count > 0) && (wm_command))
- {
- gint j;
- fprintf (f, " [WM_COMMAND] (%i)", wm_command_count);
- for (j = 0; j < wm_command_count; j++)
- {
- gchar *escaped_string;
- escaped_string = escape_quote (wm_command[j]);
- fprintf (f, " \"%s\"", escaped_string);
- g_free (escaped_string);
- }
- fprintf (f, "\n");
- XFreeStringList (wm_command);
- wm_command = NULL;
- wm_command_count = 0;
- }
-
- fprintf (f, " [GEOMETRY] (%i,%i,%i,%i)\n", c->x, c->y, c->width,
- c->height);
- fprintf (f, " [GEOMETRY-MAXIMIZED] (%i,%i,%i,%i)\n", c->old_x,
- c->old_y, c->old_width, c->old_height);
- fprintf (f, " [DESK] %i\n", c->win_workspace);
- fprintf (f, " [FLAGS] 0x%lx\n", FLAG_TEST (c->flags,
- CLIENT_FLAG_STICKY | CLIENT_FLAG_HIDDEN |
- CLIENT_FLAG_SHADED | CLIENT_FLAG_MAXIMIZED |
- CLIENT_FLAG_NAME_CHANGED));
- }
- fclose (f);
- return TRUE;
+ for (c = clients, client_idx = 0; client_idx < client_count;
+ c = c->next, client_idx++)
+ {
+ if (c->client_leader != None)
+ {
+ getWindowRole (md->dpy, c->client_leader, &window_role);
+ }
+ else
+ {
+ window_role = NULL;
+ }
+
+ fprintf (f, "[CLIENT] 0x%lx\n", c->window);
+
+ getClientID (md->dpy, c->window, &client_id);
+ if (client_id)
+ {
+ fprintf (f, " [CLIENT_ID] %s\n", client_id);
+ XFree (client_id);
+ client_id = NULL;
+ }
+
+ if (c->client_leader)
+ {
+ fprintf (f, " [CLIENT_LEADER] 0x%lx\n", c->client_leader);
+ }
+
+ if (window_role)
+ {
+ fprintf (f, " [WINDOW_ROLE] %s\n", window_role);
+ XFree (window_role);
+ window_role = NULL;
+ }
+
+ if (c->class.res_class)
+ {
+ fprintf (f, " [RES_NAME] %s\n", c->class.res_name);
+ }
+
+ if (c->class.res_name)
+ {
+ fprintf (f, " [RES_CLASS] %s\n", c->class.res_class);
+ }
+
+ if (c->name)
+ {
+ fprintf (f, " [WM_NAME] %s\n", c->name);
+ }
+
+ wm_command_count = 0;
+ getWindowCommand (md->dpy, c->window, &wm_command, &wm_command_count);
+ if ((wm_command_count > 0) && (wm_command))
+ {
+ gint j;
+ fprintf (f, " [WM_COMMAND] (%i)", wm_command_count);
+ for (j = 0; j < wm_command_count; j++)
+ {
+ gchar *escaped_string;
+ escaped_string = escape_quote (wm_command[j]);
+ fprintf (f, " \"%s\"", escaped_string);
+ g_free (escaped_string);
+ }
+ fprintf (f, "\n");
+ XFreeStringList (wm_command);
+ wm_command = NULL;
+ wm_command_count = 0;
+ }
+
+ fprintf (f, " [GEOMETRY] (%i,%i,%i,%i)\n", c->x, c->y, c->width,
+ c->height);
+ fprintf (f, " [GEOMETRY-MAXIMIZED] (%i,%i,%i,%i)\n", c->old_x,
+ c->old_y, c->old_width, c->old_height);
+ fprintf (f, " [DESK] %i\n", c->win_workspace);
+ fprintf (f, " [FLAGS] 0x%lx\n", FLAG_TEST (c->flags,
+ CLIENT_FLAG_STICKY | CLIENT_FLAG_HIDDEN |
+ CLIENT_FLAG_SHADED | CLIENT_FLAG_MAXIMIZED |
+ CLIENT_FLAG_NAME_CHANGED));
+ }
+ fclose (f);
+ return TRUE;
}
return FALSE;
}
@@ -359,109 +359,109 @@ sessionLoadWindowStates (gchar * filename)
g_return_val_if_fail (filename != NULL, FALSE);
if ((f = fopen (filename, "r")))
{
- while (fgets (s, sizeof (s), f))
- {
- sscanf (s, "%4000s", s1);
- if (!strcmp (s1, "[CLIENT]"))
- {
- sscanf (s, "%*s 0x%lx", &w);
- num_match++;
- matches = g_realloc (matches, sizeof (Match) * num_match);
- matches[num_match - 1].win = w;
- matches[num_match - 1].client_id = NULL;
- matches[num_match - 1].res_name = NULL;
- matches[num_match - 1].res_class = NULL;
- matches[num_match - 1].window_role = NULL;
- matches[num_match - 1].wm_name = NULL;
- matches[num_match - 1].wm_command_count = 0;
- matches[num_match - 1].wm_command = NULL;
- matches[num_match - 1].x = 0;
- matches[num_match - 1].y = 0;
- matches[num_match - 1].width = 100;
- matches[num_match - 1].height = 100;
- matches[num_match - 1].old_x = matches[num_match - 1].x;
- matches[num_match - 1].old_y = matches[num_match - 1].y;
- matches[num_match - 1].old_width =
- matches[num_match - 1].width;
- matches[num_match - 1].old_height =
- matches[num_match - 1].height;
- matches[num_match - 1].desktop = 0;
- matches[num_match - 1].used = FALSE;
- matches[num_match - 1].flags = 0;
- }
- else if (!strcmp (s1, "[GEOMETRY]"))
- {
- sscanf (s, "%*s (%i,%i,%i,%i)", &matches[num_match - 1].x,
- &matches[num_match - 1].y, &matches[num_match - 1].width,
- &matches[num_match - 1].height);
- }
- else if (!strcmp (s1, "[GEOMETRY-MAXIMIZED]"))
- {
- sscanf (s, "%*s (%i,%i,%i,%i)", &matches[num_match - 1].old_x,
- &matches[num_match - 1].old_y,
- &matches[num_match - 1].old_width,
- &matches[num_match - 1].old_height);
- }
- else if (!strcmp (s1, "[DESK]"))
- {
- sscanf (s, "%*s %i", &matches[num_match - 1].desktop);
- }
- else if (!strcmp (s1, "[CLIENT_LEADER]"))
- {
- sscanf (s, "%*s 0x%lx",
- &matches[num_match - 1].client_leader);
- }
- else if (!strcmp (s1, "[FLAGS]"))
- {
- sscanf (s, "%*s 0x%lx", &matches[num_match - 1].flags);
- }
- else if (!strcmp (s1, "[CLIENT_ID]"))
- {
- sscanf (s, "%*s %[^\n]", s1);
- matches[num_match - 1].client_id = strdup (s1);
- }
- else if (!strcmp (s1, "[WINDOW_ROLE]"))
- {
- sscanf (s, "%*s %[^\n]", s1);
- matches[num_match - 1].window_role = strdup (s1);
- }
- else if (!strcmp (s1, "[RES_NAME]"))
- {
- sscanf (s, "%*s %[^\n]", s1);
- matches[num_match - 1].res_name = strdup (s1);
- }
- else if (!strcmp (s1, "[RES_CLASS]"))
- {
- sscanf (s, "%*s %[^\n]", s1);
- matches[num_match - 1].res_class = strdup (s1);
- }
- else if (!strcmp (s1, "[WM_NAME]"))
- {
- sscanf (s, "%*s %[^\n]", s1);
- matches[num_match - 1].wm_name = strdup (s1);
- }
- else if (!strcmp (s1, "[WM_COMMAND]"))
- {
- sscanf (s, "%*s (%i)%n",
- &matches[num_match - 1].wm_command_count, &pos);
- matches[num_match - 1].wm_command =
- g_new (gchar *,
- matches[num_match - 1].wm_command_count + 1);
- for (i = 0; i < matches[num_match - 1].wm_command_count; i++)
- {
- gchar *substring;
- substring = getsubstring (s + pos, &pos1);
- pos += pos1;
- matches[num_match - 1].wm_command[i] =
- unescape_quote (substring);
- g_free (substring);
- }
- matches[num_match - 1].wm_command[matches[num_match -
- 1].wm_command_count] = NULL;
- }
- }
- fclose (f);
- return TRUE;
+ while (fgets (s, sizeof (s), f))
+ {
+ sscanf (s, "%4000s", s1);
+ if (!strcmp (s1, "[CLIENT]"))
+ {
+ sscanf (s, "%*s 0x%lx", &w);
+ num_match++;
+ matches = g_realloc (matches, sizeof (Match) * num_match);
+ matches[num_match - 1].win = w;
+ matches[num_match - 1].client_id = NULL;
+ matches[num_match - 1].res_name = NULL;
+ matches[num_match - 1].res_class = NULL;
+ matches[num_match - 1].window_role = NULL;
+ matches[num_match - 1].wm_name = NULL;
+ matches[num_match - 1].wm_command_count = 0;
+ matches[num_match - 1].wm_command = NULL;
+ matches[num_match - 1].x = 0;
+ matches[num_match - 1].y = 0;
+ matches[num_match - 1].width = 100;
+ matches[num_match - 1].height = 100;
+ matches[num_match - 1].old_x = matches[num_match - 1].x;
+ matches[num_match - 1].old_y = matches[num_match - 1].y;
+ matches[num_match - 1].old_width =
+ matches[num_match - 1].width;
+ matches[num_match - 1].old_height =
+ matches[num_match - 1].height;
+ matches[num_match - 1].desktop = 0;
+ matches[num_match - 1].used = FALSE;
+ matches[num_match - 1].flags = 0;
+ }
+ else if (!strcmp (s1, "[GEOMETRY]"))
+ {
+ sscanf (s, "%*s (%i,%i,%i,%i)", &matches[num_match - 1].x,
+ &matches[num_match - 1].y, &matches[num_match - 1].width,
+ &matches[num_match - 1].height);
+ }
+ else if (!strcmp (s1, "[GEOMETRY-MAXIMIZED]"))
+ {
+ sscanf (s, "%*s (%i,%i,%i,%i)", &matches[num_match - 1].old_x,
+ &matches[num_match - 1].old_y,
+ &matches[num_match - 1].old_width,
+ &matches[num_match - 1].old_height);
+ }
+ else if (!strcmp (s1, "[DESK]"))
+ {
+ sscanf (s, "%*s %i", &matches[num_match - 1].desktop);
+ }
+ else if (!strcmp (s1, "[CLIENT_LEADER]"))
+ {
+ sscanf (s, "%*s 0x%lx",
+ &matches[num_match - 1].client_leader);
+ }
+ else if (!strcmp (s1, "[FLAGS]"))
+ {
+ sscanf (s, "%*s 0x%lx", &matches[num_match - 1].flags);
+ }
+ else if (!strcmp (s1, "[CLIENT_ID]"))
+ {
+ sscanf (s, "%*s %[^\n]", s1);
+ matches[num_match - 1].client_id = strdup (s1);
+ }
+ else if (!strcmp (s1, "[WINDOW_ROLE]"))
+ {
+ sscanf (s, "%*s %[^\n]", s1);
+ matches[num_match - 1].window_role = strdup (s1);
+ }
+ else if (!strcmp (s1, "[RES_NAME]"))
+ {
+ sscanf (s, "%*s %[^\n]", s1);
+ matches[num_match - 1].res_name = strdup (s1);
+ }
+ else if (!strcmp (s1, "[RES_CLASS]"))
+ {
+ sscanf (s, "%*s %[^\n]", s1);
+ matches[num_match - 1].res_class = strdup (s1);
+ }
+ else if (!strcmp (s1, "[WM_NAME]"))
+ {
+ sscanf (s, "%*s %[^\n]", s1);
+ matches[num_match - 1].wm_name = strdup (s1);
+ }
+ else if (!strcmp (s1, "[WM_COMMAND]"))
+ {
+ sscanf (s, "%*s (%i)%n",
+ &matches[num_match - 1].wm_command_count, &pos);
+ matches[num_match - 1].wm_command =
+ g_new (gchar *,
+ matches[num_match - 1].wm_command_count + 1);
+ for (i = 0; i < matches[num_match - 1].wm_command_count; i++)
+ {
+ gchar *substring;
+ substring = getsubstring (s + pos, &pos1);
+ pos += pos1;
+ matches[num_match - 1].wm_command[i] =
+ unescape_quote (substring);
+ g_free (substring);
+ }
+ matches[num_match - 1].wm_command[matches[num_match -
+ 1].wm_command_count] = NULL;
+ }
+ }
+ fclose (f);
+ return TRUE;
}
return FALSE;
}
@@ -472,45 +472,45 @@ sessionFreeWindowStates (void)
int i;
for (i = 0; i < num_match; i++)
{
- if (matches[i].client_id)
- {
- free (matches[i].client_id);
- matches[i].client_id = NULL;
- }
- if (matches[i].res_name)
- {
- free (matches[i].res_name);
- matches[i].res_name = NULL;
- }
- if (matches[i].res_class)
- {
- free (matches[i].res_class);
- matches[i].res_class = NULL;
- }
- if (matches[i].window_role)
- {
- free (matches[i].window_role);
- matches[i].window_role = NULL;
- }
- if (matches[i].wm_name)
- {
- free (matches[i].wm_name);
- matches[i].wm_name = NULL;
- }
- if ((matches[i].wm_command_count) && (matches[i].wm_command))
- {
- my_free_string_list (matches[i].wm_command,
- matches[i].wm_command_count);
- g_free (matches[i].wm_command);
- matches[i].wm_command_count = 0;
- matches[i].wm_command = NULL;
- }
+ if (matches[i].client_id)
+ {
+ free (matches[i].client_id);
+ matches[i].client_id = NULL;
+ }
+ if (matches[i].res_name)
+ {
+ free (matches[i].res_name);
+ matches[i].res_name = NULL;
+ }
+ if (matches[i].res_class)
+ {
+ free (matches[i].res_class);
+ matches[i].res_class = NULL;
+ }
+ if (matches[i].window_role)
+ {
+ free (matches[i].window_role);
+ matches[i].window_role = NULL;
+ }
+ if (matches[i].wm_name)
+ {
+ free (matches[i].wm_name);
+ matches[i].wm_name = NULL;
+ }
+ if ((matches[i].wm_command_count) && (matches[i].wm_command))
+ {
+ my_free_string_list (matches[i].wm_command,
+ matches[i].wm_command_count);
+ g_free (matches[i].wm_command);
+ matches[i].wm_command_count = 0;
+ matches[i].wm_command = NULL;
+ }
}
if (matches)
{
- g_free (matches);
- matches = NULL;
- num_match = 0;
+ g_free (matches);
+ matches = NULL;
+ num_match = 0;
}
}
@@ -531,99 +531,99 @@ matchWin (Client * c, Match * m)
g_return_val_if_fail (c != NULL, FALSE);
found = FALSE;
- getClientID (dpy, c->window, &client_id);
+ getClientID (md->dpy, c->window, &client_id);
if (xstreq (client_id, m->client_id))
{
- /* client_id's match */
- if (c->client_leader != None)
- {
- getWindowRole (dpy, c->client_leader, &window_role);
- }
- else
- {
- window_role = NULL;
- }
- if ((window_role) || (m->window_role))
- {
- /* We have or had a window role, base decision on it */
- found = xstreq (window_role, m->window_role);
- }
- else
- {
- /* Compare res_class, res_name and WM_NAME, unless the
- * WM_NAME has changed
- */
- if (xstreq (c->class.res_name, m->res_name)
- && (FLAG_TEST (c->flags, CLIENT_FLAG_NAME_CHANGED)
- || (m->flags & CLIENT_FLAG_NAME_CHANGED)
- || xstreq (c->name, m->wm_name)))
- {
- if (client_id)
- {
- /* If we have a client_id, we don't compare
- WM_COMMAND, since it will be different. */
- found = TRUE;
-
- }
- else
- {
- /* for non-SM-aware clients we also compare WM_COMMAND */
- wm_command_count = 0;
- getWindowCommand (dpy, c->window, &wm_command,
- &wm_command_count);
- if (wm_command_count == m->wm_command_count)
- {
- for (i = 0; i < wm_command_count; i++)
- {
- if (strcmp (wm_command[i], m->wm_command[i]) != 0)
- break;
- }
-
- if ((i == wm_command_count) && (wm_command_count))
- {
- found = TRUE;
- }
- } /* if (wm_command_count ==... */
- /* We have to deal with a now-SM-aware client, it means that it won't probably
- * restore its state in a proper manner.
- * Thus, we also mark all other instances of this application as used, to avoid
- * dummy side effects in case we found a matching entry.
- */
- if (found)
- {
- for (i = 0; i < num_match; i++)
- {
- if (!(matches[i].used) && !(&matches[i] == m)
- && (m->client_leader)
- && (matches[i].client_leader ==
- m->client_leader))
- {
- matches[i].used = TRUE;
- }
- }
- }
- }
- }
- }
+ /* client_id's match */
+ if (c->client_leader != None)
+ {
+ getWindowRole (md->dpy, c->client_leader, &window_role);
+ }
+ else
+ {
+ window_role = NULL;
+ }
+ if ((window_role) || (m->window_role))
+ {
+ /* We have or had a window role, base decision on it */
+ found = xstreq (window_role, m->window_role);
+ }
+ else
+ {
+ /* Compare res_class, res_name and WM_NAME, unless the
+ * WM_NAME has changed
+ */
+ if (xstreq (c->class.res_name, m->res_name)
+ && (FLAG_TEST (c->flags, CLIENT_FLAG_NAME_CHANGED)
+ || (m->flags & CLIENT_FLAG_NAME_CHANGED)
+ || xstreq (c->name, m->wm_name)))
+ {
+ if (client_id)
+ {
+ /* If we have a client_id, we don't compare
+ WM_COMMAND, since it will be different. */
+ found = TRUE;
+
+ }
+ else
+ {
+ /* for non-SM-aware clients we also compare WM_COMMAND */
+ wm_command_count = 0;
+ getWindowCommand (md->dpy, c->window, &wm_command,
+ &wm_command_count);
+ if (wm_command_count == m->wm_command_count)
+ {
+ for (i = 0; i < wm_command_count; i++)
+ {
+ if (strcmp (wm_command[i], m->wm_command[i]) != 0)
+ break;
+ }
+
+ if ((i == wm_command_count) && (wm_command_count))
+ {
+ found = TRUE;
+ }
+ } /* if (wm_command_count ==... */
+ /* We have to deal with a now-SM-aware client, it means that it won't probably
+ * restore its state in a proper manner.
+ * Thus, we also mark all other instances of this application as used, to avoid
+ * dummy side effects in case we found a matching entry.
+ */
+ if (found)
+ {
+ for (i = 0; i < num_match; i++)
+ {
+ if (!(matches[i].used) && !(&matches[i] == m)
+ && (m->client_leader)
+ && (matches[i].client_leader ==
+ m->client_leader))
+ {
+ matches[i].used = TRUE;
+ }
+ }
+ }
+ }
+ }
+ }
}
if (client_id)
{
- XFree (client_id);
- client_id = NULL;
+ XFree (client_id);
+ client_id = NULL;
}
if (window_role)
{
- XFree (window_role);
- window_role = NULL;
+ XFree (window_role);
+ window_role = NULL;
}
if ((wm_command_count > 0) && (wm_command))
{
- XFreeStringList (wm_command);
- wm_command = NULL;
- wm_command_count = 0;
+ XFreeStringList (wm_command);
+ wm_command = NULL;
+ wm_command_count = 0;
}
return found;
@@ -637,25 +637,25 @@ sessionMatchWinToSM (Client * c)
g_return_val_if_fail (c != NULL, FALSE);
for (i = 0; i < num_match; i++)
{
- if (!matches[i].used && matchWin (c, &matches[i]))
- {
- matches[i].used = TRUE;
- c->x = matches[i].x;
- c->y = matches[i].y;
- c->width = matches[i].width;
- c->height = matches[i].height;
- c->old_x = matches[i].old_x;
- c->old_y = matches[i].old_y;
- c->old_width = matches[i].old_width;
- c->old_height = matches[i].old_height;
- c->win_workspace = matches[i].desktop;
- FLAG_SET (c->flags,
- matches[i].
- flags & (CLIENT_FLAG_STICKY | CLIENT_FLAG_SHADED |
- CLIENT_FLAG_MAXIMIZED | CLIENT_FLAG_HIDDEN));
- FLAG_SET (c->flags, CLIENT_FLAG_WORKSPACE_SET);
- return TRUE;
- }
+ if (!matches[i].used && matchWin (c, &matches[i]))
+ {
+ matches[i].used = TRUE;
+ c->x = matches[i].x;
+ c->y = matches[i].y;
+ c->width = matches[i].width;
+ c->height = matches[i].height;
+ c->old_x = matches[i].old_x;
+ c->old_y = matches[i].old_y;
+ c->old_width = matches[i].old_width;
+ c->old_height = matches[i].old_height;
+ c->win_workspace = matches[i].desktop;
+ FLAG_SET (c->flags,
+ matches[i].
+ flags & (CLIENT_FLAG_STICKY | CLIENT_FLAG_SHADED |
+ CLIENT_FLAG_MAXIMIZED | CLIENT_FLAG_HIDDEN));
+ FLAG_SET (c->flags, CLIENT_FLAG_WORKSPACE_SET);
+ return TRUE;
+ }
}
return FALSE;
}
diff --git a/src/session.h b/src/session.h
index 5b841c2b5..cd2a548df 100644
--- a/src/session.h
+++ b/src/session.h
@@ -12,7 +12,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- xfwm4 - (c) 2003 Olivier Fourdan
+ xfwm4 - (c) 2003 Olivier Fourdan
*/
diff --git a/src/settings.c b/src/settings.c
index 7d268fe6a..5526ba28a 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
#ifdef HAVE_CONFIG_H
@@ -59,40 +59,40 @@ set_settings_margin (int idx, int value)
switch (idx)
{
- case LEFT:
- case RIGHT:
- if (value < 0)
- {
- val = 0;
- }
- else if (value > gdk_screen_get_width (gscr) / 4)
- {
- val = gdk_screen_get_width (gscr) / 4;
- }
- else
- {
- val = value;
- }
- params.xfwm_margins[idx] = val;
- break;
- case TOP:
- case BOTTOM:
- if (value < 0)
- {
- val = 0;
- }
- else if (value > gdk_screen_get_height (gscr) / 4)
- {
- val = gdk_screen_get_height (gscr) / 4;
- }
- else
- {
- val = value;
- }
- params.xfwm_margins[idx] = val;
- break;
- default:
- break;
+ case LEFT:
+ case RIGHT:
+ if (value < 0)
+ {
+ val = 0;
+ }
+ else if (value > gdk_screen_get_width (md->gscr) / 4)
+ {
+ val = gdk_screen_get_width (md->gscr) / 4;
+ }
+ else
+ {
+ val = value;
+ }
+ params.xfwm_margins[idx] = val;
+ break;
+ case TOP:
+ case BOTTOM:
+ if (value < 0)
+ {
+ val = 0;
+ }
+ else if (value > gdk_screen_get_height (md->gscr) / 4)
+ {
+ val = gdk_screen_get_height (md->gscr) / 4;
+ }
+ else
+ {
+ val = value;
+ }
+ params.xfwm_margins[idx] = val;
+ break;
+ default:
+ break;
}
}
@@ -102,167 +102,167 @@ notify_cb (const char *name, const char *channel_name, McsAction action,
{
if (!g_ascii_strcasecmp (CHANNEL1, channel_name))
{
- switch (action)
- {
- case MCS_ACTION_NEW:
- /* The following is to reduce initial startup time and reloads */
- if (!mcs_initted)
- {
- return;
- }
- case MCS_ACTION_CHANGED:
- if (setting->type == MCS_TYPE_INT)
- {
- if (!strcmp (name, "Xfwm/ClickToFocus"))
- {
- params.click_to_focus = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/FocusNewWindow"))
- {
- params.focus_new = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/FocusRaise"))
- {
- params.raise_on_focus = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/RaiseDelay"))
- {
- params.raise_delay = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/RaiseOnClick"))
- {
- params.raise_on_click = setting->data.v_int;
- clientPassGrabButton1 (NULL);
- }
- else if (!strcmp (name, "Xfwm/SnapToBorder"))
- {
- params.snap_to_border = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/SnapToWindows"))
- {
- params.snap_to_windows = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/SnapWidth"))
- {
- params.snap_width = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/WrapWorkspaces"))
- {
- params.wrap_workspaces = setting->data.v_int;
- placeSidewalks (params.wrap_workspaces);
- }
- else if (!strcmp (name, "Xfwm/WrapWindows"))
- {
- params.wrap_windows = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/WrapResistance"))
- {
- params.wrap_resistance = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/BoxMove"))
- {
- params.box_move = setting->data.v_int;
- }
- else if (!strcmp (name, "Xfwm/BoxResize"))
- {
- params.box_resize = setting->data.v_int;
- }
- }
- else if (setting->type == MCS_TYPE_STRING)
- {
- if (!strcmp (name, "Xfwm/DblClickAction"))
- {
- reloadSettings (NO_UPDATE_FLAG);
- }
- else if (!strcmp (name, "Xfwm/KeyThemeName"))
- {
- reloadSettings (UPDATE_KEYGRABS);
- }
- else if (!strcmp (name, "Xfwm/ThemeName"))
- {
- reloadSettings (UPDATE_GRAVITY | UPDATE_CACHE);
- }
- else if (!strcmp (name, "Xfwm/ButtonLayout"))
- {
- reloadSettings (UPDATE_FRAME | UPDATE_CACHE);
- }
- if (!strcmp (name, "Xfwm/TitleAlign"))
- {
- reloadSettings (UPDATE_FRAME | UPDATE_CACHE);
- }
- if (!strcmp (name, "Xfwm/TitleFont"))
- {
- reloadSettings (UPDATE_FRAME | UPDATE_CACHE);
- }
- }
- break;
- case MCS_ACTION_DELETED:
- default:
- break;
- }
+ switch (action)
+ {
+ case MCS_ACTION_NEW:
+ /* The following is to reduce initial startup time and md->reloads */
+ if (!mcs_initted)
+ {
+ return;
+ }
+ case MCS_ACTION_CHANGED:
+ if (setting->type == MCS_TYPE_INT)
+ {
+ if (!strcmp (name, "Xfwm/ClickToFocus"))
+ {
+ params.click_to_focus = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/FocusNewWindow"))
+ {
+ params.focus_new = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/FocusRaise"))
+ {
+ params.raise_on_focus = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/RaiseDelay"))
+ {
+ params.raise_delay = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/RaiseOnClick"))
+ {
+ params.raise_on_click = setting->data.v_int;
+ clientPassGrabButton1 (NULL);
+ }
+ else if (!strcmp (name, "Xfwm/SnapToBorder"))
+ {
+ params.snap_to_border = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/SnapToWindows"))
+ {
+ params.snap_to_windows = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/SnapWidth"))
+ {
+ params.snap_width = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/WrapWorkspaces"))
+ {
+ params.wrap_workspaces = setting->data.v_int;
+ placeSidewalks (params.wrap_workspaces);
+ }
+ else if (!strcmp (name, "Xfwm/WrapWindows"))
+ {
+ params.wrap_windows = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/WrapResistance"))
+ {
+ params.wrap_resistance = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/BoxMove"))
+ {
+ params.box_move = setting->data.v_int;
+ }
+ else if (!strcmp (name, "Xfwm/BoxResize"))
+ {
+ params.box_resize = setting->data.v_int;
+ }
+ }
+ else if (setting->type == MCS_TYPE_STRING)
+ {
+ if (!strcmp (name, "Xfwm/DblClickAction"))
+ {
+ reloadSettings (NO_UPDATE_FLAG);
+ }
+ else if (!strcmp (name, "Xfwm/KeyThemeName"))
+ {
+ reloadSettings (UPDATE_KEYGRABS);
+ }
+ else if (!strcmp (name, "Xfwm/ThemeName"))
+ {
+ reloadSettings (UPDATE_GRAVITY | UPDATE_CACHE);
+ }
+ else if (!strcmp (name, "Xfwm/ButtonLayout"))
+ {
+ reloadSettings (UPDATE_FRAME | UPDATE_CACHE);
+ }
+ if (!strcmp (name, "Xfwm/TitleAlign"))
+ {
+ reloadSettings (UPDATE_FRAME | UPDATE_CACHE);
+ }
+ if (!strcmp (name, "Xfwm/TitleFont"))
+ {
+ reloadSettings (UPDATE_FRAME | UPDATE_CACHE);
+ }
+ }
+ break;
+ case MCS_ACTION_DELETED:
+ default:
+ break;
+ }
}
else if (!g_ascii_strcasecmp (CHANNEL2, channel_name))
{
- switch (action)
- {
- case MCS_ACTION_NEW:
- /* The following is to reduce initial startup time and reloads */
- if (!mcs_initted)
- {
- return;
- }
- case MCS_ACTION_CHANGED:
- if (setting->type == MCS_TYPE_INT)
- {
- if (!strcmp (name, "Xfwm/LeftMargin"))
- {
- set_settings_margin (LEFT,
- setting->data.v_int);
- }
- else if (!strcmp (name, "Xfwm/RightMargin"))
- {
- set_settings_margin (RIGHT,
- setting->data.v_int);
- }
- else if (!strcmp (name, "Xfwm/BottomMargin"))
- {
- set_settings_margin (BOTTOM,
- setting->data.v_int);
- }
- else if (!strcmp (name, "Xfwm/TopMargin"))
- {
- set_settings_margin (TOP, setting->data.v_int);
- }
- }
- break;
- case MCS_ACTION_DELETED:
- default:
- break;
- }
+ switch (action)
+ {
+ case MCS_ACTION_NEW:
+ /* The following is to reduce initial startup time and md->reloads */
+ if (!mcs_initted)
+ {
+ return;
+ }
+ case MCS_ACTION_CHANGED:
+ if (setting->type == MCS_TYPE_INT)
+ {
+ if (!strcmp (name, "Xfwm/LeftMargin"))
+ {
+ set_settings_margin (LEFT,
+ setting->data.v_int);
+ }
+ else if (!strcmp (name, "Xfwm/RightMargin"))
+ {
+ set_settings_margin (RIGHT,
+ setting->data.v_int);
+ }
+ else if (!strcmp (name, "Xfwm/BottomMargin"))
+ {
+ set_settings_margin (BOTTOM,
+ setting->data.v_int);
+ }
+ else if (!strcmp (name, "Xfwm/TopMargin"))
+ {
+ set_settings_margin (TOP, setting->data.v_int);
+ }
+ }
+ break;
+ case MCS_ACTION_DELETED:
+ default:
+ break;
+ }
}
else if (!g_ascii_strcasecmp (CHANNEL3, channel_name))
{
- switch (action)
- {
- case MCS_ACTION_NEW:
- /* The following is to reduce initial startup time and reloads */
- if (!mcs_initted)
- {
- return;
- }
- case MCS_ACTION_CHANGED:
- if (setting->type == MCS_TYPE_INT)
- {
- if (!strcmp (name, "Xfwm/WorkspaceCount"))
- {
- workspaceSetCount(setting->data.v_int);
- }
- }
- break;
- case MCS_ACTION_DELETED:
- default:
- break;
- }
+ switch (action)
+ {
+ case MCS_ACTION_NEW:
+ /* The following is to reduce initial startup time and md->reloads */
+ if (!mcs_initted)
+ {
+ return;
+ }
+ case MCS_ACTION_CHANGED:
+ if (setting->type == MCS_TYPE_INT)
+ {
+ if (!strcmp (name, "Xfwm/WorkspaceCount"))
+ {
+ workspaceSetCount(setting->data.v_int);
+ }
+ }
+ break;
+ case MCS_ACTION_DELETED:
+ default:
+ break;
+ }
}
}
@@ -270,9 +270,9 @@ static GdkFilterReturn
client_event_filter (GdkXEvent * xevent, GdkEvent * event, gpointer data)
{
if (mcs_client_process_event (client, (XEvent *) xevent))
- return GDK_FILTER_REMOVE;
+ return GDK_FILTER_REMOVE;
else
- return GDK_FILTER_CONTINUE;
+ return GDK_FILTER_CONTINUE;
}
static void
@@ -284,21 +284,21 @@ watch_cb (Window window, Bool is_start, long mask, void *cb_data)
if (is_start)
{
- if (!gdkwin)
- {
- gdkwin = gdk_window_foreign_new (window);
- }
- else
- {
- g_object_ref (gdkwin);
- }
- gdk_window_add_filter (gdkwin, client_event_filter, cb_data);
+ if (!gdkwin)
+ {
+ gdkwin = gdk_window_foreign_new (window);
+ }
+ else
+ {
+ g_object_ref (gdkwin);
+ }
+ gdk_window_add_filter (gdkwin, client_event_filter, cb_data);
}
else
{
- g_assert (gdkwin);
- gdk_window_remove_filter (gdkwin, client_event_filter, cb_data);
- g_object_unref (gdkwin);
+ g_assert (gdkwin);
+ gdk_window_remove_filter (gdkwin, client_event_filter, cb_data);
+ g_object_unref (gdkwin);
}
}
@@ -311,15 +311,15 @@ loadRcData (Settings rc[])
if (!parseRc ("defaults", PACKAGE_DATADIR, rc))
{
- g_warning (_("%s: Missing defaults file"), progname);
- exit (1);
+ g_warning (_("%s: Missing defaults file"), md->progname);
+ exit (1);
}
keythemevalue = getValue ("keytheme", rc);
if (keythemevalue)
{
- keytheme = getThemeDir (keythemevalue, KEYTHEMERC);
- parseRc (KEYTHEMERC, keytheme, rc);
- g_free (keytheme);
+ keytheme = getThemeDir (keythemevalue, KEYTHEMERC);
+ parseRc (KEYTHEMERC, keytheme, rc);
+ g_free (keytheme);
}
parseRc ("xfwm4rc", homedir, rc);
}
@@ -330,151 +330,151 @@ loadMcsData (Settings rc[])
McsSetting *setting;
if (client)
{
- if (mcs_client_get_setting (client, "Xfwm/ClickToFocus", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("click_to_focus", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/FocusNewWindow", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("focus_new", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/FocusRaise", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("raise_on_focus", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/RaiseDelay", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setIntValueFromInt ("raise_delay", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/RaiseOnClick", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("raise_on_click", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/SnapToBorder", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("snap_to_border", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/SnapToWindows", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("snap_to_windows", setting->data.v_int,
- rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/SnapWidth", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setIntValueFromInt ("snap_width", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/WrapWorkspaces", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("wrap_workspaces", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/WrapWindows", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("wrap_windows", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/WrapResistance", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setIntValueFromInt ("wrap_resistance", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/BoxMove", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("box_move", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/BoxResize", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setBooleanValueFromInt ("box_resize", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/DblClickAction", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setValue ("double_click_action", setting->data.v_string, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/ThemeName", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setValue ("theme", setting->data.v_string, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/KeyThemeName", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setValue ("keytheme", setting->data.v_string, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/ButtonLayout", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setValue ("button_layout", setting->data.v_string, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/TitleAlign", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setValue ("title_alignment", setting->data.v_string, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/TitleFont", CHANNEL1,
- &setting) == MCS_SUCCESS)
- {
- setValue ("title_font", setting->data.v_string, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/LeftMargin", CHANNEL2,
- &setting) == MCS_SUCCESS)
- {
- setIntValueFromInt ("margin_left", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/RightMargin", CHANNEL2,
- &setting) == MCS_SUCCESS)
- {
- setIntValueFromInt ("margin_right", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/BottomMargin", CHANNEL2,
- &setting) == MCS_SUCCESS)
- {
- setIntValueFromInt ("margin_bottom", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/TopMargin", CHANNEL2,
- &setting) == MCS_SUCCESS)
- {
- setIntValueFromInt ("margin_top", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
- if (mcs_client_get_setting (client, "Xfwm/WorkspaceCount", CHANNEL3,
- &setting) == MCS_SUCCESS)
- {
- setIntValueFromInt ("workspace_count", setting->data.v_int, rc);
- mcs_setting_free (setting);
- }
+ if (mcs_client_get_setting (client, "Xfwm/ClickToFocus", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("click_to_focus", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/FocusNewWindow", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("focus_new", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/FocusRaise", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("raise_on_focus", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/RaiseDelay", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setIntValueFromInt ("raise_delay", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/RaiseOnClick", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("raise_on_click", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/SnapToBorder", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("snap_to_border", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/SnapToWindows", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("snap_to_windows", setting->data.v_int,
+ rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/SnapWidth", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setIntValueFromInt ("snap_width", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/WrapWorkspaces", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("wrap_workspaces", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/WrapWindows", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("wrap_windows", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/WrapResistance", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setIntValueFromInt ("wrap_resistance", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/BoxMove", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("box_move", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/BoxResize", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setBooleanValueFromInt ("box_resize", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/DblClickAction", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setValue ("double_click_action", setting->data.v_string, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/ThemeName", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setValue ("theme", setting->data.v_string, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/KeyThemeName", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setValue ("keytheme", setting->data.v_string, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/ButtonLayout", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setValue ("button_layout", setting->data.v_string, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/TitleAlign", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setValue ("title_alignment", setting->data.v_string, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/TitleFont", CHANNEL1,
+ &setting) == MCS_SUCCESS)
+ {
+ setValue ("title_font", setting->data.v_string, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/LeftMargin", CHANNEL2,
+ &setting) == MCS_SUCCESS)
+ {
+ setIntValueFromInt ("margin_left", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/RightMargin", CHANNEL2,
+ &setting) == MCS_SUCCESS)
+ {
+ setIntValueFromInt ("margin_right", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/BottomMargin", CHANNEL2,
+ &setting) == MCS_SUCCESS)
+ {
+ setIntValueFromInt ("margin_bottom", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/TopMargin", CHANNEL2,
+ &setting) == MCS_SUCCESS)
+ {
+ setIntValueFromInt ("margin_top", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
+ if (mcs_client_get_setting (client, "Xfwm/WorkspaceCount", CHANNEL3,
+ &setting) == MCS_SUCCESS)
+ {
+ setIntValueFromInt ("workspace_count", setting->data.v_int, rc);
+ mcs_setting_free (setting);
+ }
}
}
@@ -484,7 +484,7 @@ loadTheme (Settings rc[])
gchar *theme;
gchar *font;
XpmColorSymbol colsym[20];
- GtkWidget *widget = getDefaultGtkWidget ();
+ GtkWidget *widget = getDefaultGtkWidget (md->gtox_data);
PangoFontDescription *desc;
guint i;
@@ -514,242 +514,242 @@ loadTheme (Settings rc[])
for (i = 0; i < 20; i++)
{
- colsym[i].name = rc[i].option;
- colsym[i].value = rc[i].value;
+ colsym[i].name = rc[i].option;
+ colsym[i].value = rc[i].value;
}
if (params.title_colors[ACTIVE].allocated)
{
- gdk_colormap_free_colors (gdk_screen_get_rgb_colormap (gscr),
- &params.title_colors[ACTIVE].col, 1);
- params.title_colors[ACTIVE].allocated = FALSE;
+ gdk_colormap_free_colors (gdk_screen_get_rgb_colormap (md->gscr),
+ &params.title_colors[ACTIVE].col, 1);
+ params.title_colors[ACTIVE].allocated = FALSE;
}
if (gdk_color_parse (rc[0].value, &params.title_colors[ACTIVE].col))
{
- if (gdk_colormap_alloc_color (gdk_screen_get_rgb_colormap (gscr),
- &params.title_colors[ACTIVE].col, FALSE, FALSE))
- {
- params.title_colors[ACTIVE].allocated = TRUE;
- if (params.title_colors[ACTIVE].gc)
- {
- g_object_unref (G_OBJECT (params.title_colors[ACTIVE].gc));
- }
- params.title_colors[ACTIVE].gc =
- gdk_gc_new (getDefaultGdkWindow ());
- gdk_gc_copy (params.title_colors[ACTIVE].gc, get_style_gc (widget,
- "text", "selected"));
- gdk_gc_set_foreground (params.title_colors[ACTIVE].gc,
- &params.title_colors[ACTIVE].col);
- }
- else
- {
- gdk_beep ();
- g_message (_("%s: Cannot allocate active color %s\n"),
- g_get_prgname (), rc[0].value);
- }
+ if (gdk_colormap_alloc_color (gdk_screen_get_rgb_colormap (md->gscr),
+ &params.title_colors[ACTIVE].col, FALSE, FALSE))
+ {
+ params.title_colors[ACTIVE].allocated = TRUE;
+ if (params.title_colors[ACTIVE].gc)
+ {
+ g_object_unref (G_OBJECT (params.title_colors[ACTIVE].gc));
+ }
+ params.title_colors[ACTIVE].gc =
+ gdk_gc_new (getDefaultGdkWindow (md->gtox_data));
+ gdk_gc_copy (params.title_colors[ACTIVE].gc, get_style_gc (widget,
+ "text", "selected"));
+ gdk_gc_set_foreground (params.title_colors[ACTIVE].gc,
+ &params.title_colors[ACTIVE].col);
+ }
+ else
+ {
+ gdk_beep ();
+ g_message (_("%s: Cannot allocate active color %s\n"),
+ g_get_prgname (), rc[0].value);
+ }
}
else
{
- gdk_beep ();
- g_message (_("%s: Cannot parse active color %s\n"), g_get_prgname (),
- rc[0].value);
+ gdk_beep ();
+ g_message (_("%s: Cannot parse active color %s\n"), g_get_prgname (),
+ rc[0].value);
}
if (params.black_gc)
{
- g_object_unref (G_OBJECT (params.black_gc));
+ g_object_unref (G_OBJECT (params.black_gc));
}
params.black_gc = widget->style->black_gc;
g_object_ref (G_OBJECT (widget->style->black_gc));
if (params.white_gc)
{
- g_object_unref (G_OBJECT (params.white_gc));
+ g_object_unref (G_OBJECT (params.white_gc));
}
params.white_gc = widget->style->white_gc;
g_object_ref (G_OBJECT (widget->style->white_gc));
if (params.title_colors[INACTIVE].allocated)
{
- gdk_colormap_free_colors (gdk_screen_get_rgb_colormap (gscr),
- &params.title_colors[INACTIVE].col, 1);
- params.title_colors[INACTIVE].allocated = FALSE;
+ gdk_colormap_free_colors (gdk_screen_get_rgb_colormap (md->gscr),
+ &params.title_colors[INACTIVE].col, 1);
+ params.title_colors[INACTIVE].allocated = FALSE;
}
if (gdk_color_parse (rc[1].value, &params.title_colors[INACTIVE].col))
{
- if (gdk_colormap_alloc_color (gdk_screen_get_rgb_colormap (gscr),
- &params.title_colors[INACTIVE].col, FALSE, FALSE))
- {
- params.title_colors[INACTIVE].allocated = TRUE;
- if (params.title_colors[INACTIVE].gc)
- {
- g_object_unref (G_OBJECT (params.title_colors[INACTIVE].gc));
- }
- params.title_colors[INACTIVE].gc =
- gdk_gc_new (getDefaultGdkWindow ());
- gdk_gc_copy (params.title_colors[INACTIVE].gc,
- get_style_gc (widget, "text", "normal"));
- gdk_gc_set_foreground (params.title_colors[INACTIVE].gc,
- &params.title_colors[INACTIVE].col);
- }
- else
- {
- gdk_beep ();
- g_message (_("%s: Cannot allocate inactive color %s\n"),
- g_get_prgname (), rc[1].value);
- }
+ if (gdk_colormap_alloc_color (gdk_screen_get_rgb_colormap (md->gscr),
+ &params.title_colors[INACTIVE].col, FALSE, FALSE))
+ {
+ params.title_colors[INACTIVE].allocated = TRUE;
+ if (params.title_colors[INACTIVE].gc)
+ {
+ g_object_unref (G_OBJECT (params.title_colors[INACTIVE].gc));
+ }
+ params.title_colors[INACTIVE].gc =
+ gdk_gc_new (getDefaultGdkWindow (md->gtox_data));
+ gdk_gc_copy (params.title_colors[INACTIVE].gc,
+ get_style_gc (widget, "text", "normal"));
+ gdk_gc_set_foreground (params.title_colors[INACTIVE].gc,
+ &params.title_colors[INACTIVE].col);
+ }
+ else
+ {
+ gdk_beep ();
+ g_message (_("%s: Cannot allocate inactive color %s\n"),
+ g_get_prgname (), rc[1].value);
+ }
}
else
{
- gdk_beep ();
- g_message (_("%s: Cannot parse inactive color %s\n"),
- g_get_prgname (), rc[1].value);
+ gdk_beep ();
+ g_message (_("%s: Cannot parse inactive color %s\n"),
+ g_get_prgname (), rc[1].value);
}
font = getValue ("title_font", rc);
if (font && strlen (font))
{
- desc = pango_font_description_from_string (font);
- if (desc)
- {
- gtk_widget_modify_font (widget, desc);
- }
+ desc = pango_font_description_from_string (font);
+ if (desc)
+ {
+ gtk_widget_modify_font (widget, desc);
+ }
}
- myPixmapLoad (dpy, &params.sides[SIDE_LEFT][ACTIVE], theme,
- "left-active", colsym, 20);
- myPixmapLoad (dpy, &params.sides[SIDE_LEFT][INACTIVE], theme,
- "left-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.sides[SIDE_RIGHT][ACTIVE], theme,
- "right-active", colsym, 20);
- myPixmapLoad (dpy, &params.sides[SIDE_RIGHT][INACTIVE], theme,
- "right-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.sides[SIDE_BOTTOM][ACTIVE], theme,
- "bottom-active", colsym, 20);
- myPixmapLoad (dpy, &params.sides[SIDE_BOTTOM][INACTIVE], theme,
- "bottom-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.corners[CORNER_TOP_LEFT][ACTIVE], theme,
- "top-left-active", colsym, 20);
- myPixmapLoad (dpy, &params.corners[CORNER_TOP_LEFT][INACTIVE], theme,
- "top-left-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.corners[CORNER_TOP_RIGHT][ACTIVE], theme,
- "top-right-active", colsym, 20);
- myPixmapLoad (dpy, &params.corners[CORNER_TOP_RIGHT][INACTIVE], theme,
- "top-right-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.corners[CORNER_BOTTOM_LEFT][ACTIVE], theme,
- "bottom-left-active", colsym, 20);
- myPixmapLoad (dpy, &params.corners[CORNER_BOTTOM_LEFT][INACTIVE], theme,
- "bottom-left-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.corners[CORNER_BOTTOM_RIGHT][ACTIVE], theme,
- "bottom-right-active", colsym, 20);
- myPixmapLoad (dpy, &params.corners[CORNER_BOTTOM_RIGHT][INACTIVE], theme,
- "bottom-right-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[HIDE_BUTTON][ACTIVE], theme,
- "hide-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[HIDE_BUTTON][INACTIVE], theme,
- "hide-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[HIDE_BUTTON][PRESSED], theme,
- "hide-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[CLOSE_BUTTON][ACTIVE], theme,
- "close-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[CLOSE_BUTTON][INACTIVE], theme,
- "close-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[CLOSE_BUTTON][PRESSED], theme,
- "close-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MAXIMIZE_BUTTON][ACTIVE], theme,
- "maximize-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MAXIMIZE_BUTTON][INACTIVE], theme,
- "maximize-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MAXIMIZE_BUTTON][PRESSED], theme,
- "maximize-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[SHADE_BUTTON][ACTIVE], theme,
- "shade-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[SHADE_BUTTON][INACTIVE], theme,
- "shade-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[SHADE_BUTTON][PRESSED], theme,
- "shade-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[STICK_BUTTON][ACTIVE], theme,
- "stick-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[STICK_BUTTON][INACTIVE], theme,
- "stick-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[STICK_BUTTON][PRESSED], theme,
- "stick-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MENU_BUTTON][ACTIVE], theme,
- "menu-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MENU_BUTTON][INACTIVE], theme,
- "menu-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MENU_BUTTON][PRESSED], theme,
- "menu-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[SHADE_BUTTON][T_ACTIVE], theme,
- "shade-toggled-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[SHADE_BUTTON][T_INACTIVE], theme,
- "shade-toggled-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[SHADE_BUTTON][T_PRESSED], theme,
- "shade-toggled-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[STICK_BUTTON][T_ACTIVE], theme,
- "stick-toggled-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[STICK_BUTTON][T_INACTIVE], theme,
- "stick-toggled-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[STICK_BUTTON][T_PRESSED], theme,
- "stick-toggled-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MAXIMIZE_BUTTON][T_ACTIVE], theme,
- "maximize-toggled-active", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MAXIMIZE_BUTTON][T_INACTIVE], theme,
- "maximize-toggled-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.buttons[MAXIMIZE_BUTTON][T_PRESSED], theme,
- "maximize-toggled-pressed", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_1][ACTIVE], theme,
- "title-1-active", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_1][INACTIVE], theme,
- "title-1-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_2][ACTIVE], theme,
- "title-2-active", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_2][INACTIVE], theme,
- "title-2-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_3][ACTIVE], theme,
- "title-3-active", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_3][INACTIVE], theme,
- "title-3-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_4][ACTIVE], theme,
- "title-4-active", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_4][INACTIVE], theme,
- "title-4-inactive", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_5][ACTIVE], theme,
- "title-5-active", colsym, 20);
- myPixmapLoad (dpy, &params.title[TITLE_5][INACTIVE], theme,
- "title-5-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.sides[SIDE_LEFT][ACTIVE], theme,
+ "left-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.sides[SIDE_LEFT][INACTIVE], theme,
+ "left-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.sides[SIDE_RIGHT][ACTIVE], theme,
+ "right-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.sides[SIDE_RIGHT][INACTIVE], theme,
+ "right-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.sides[SIDE_BOTTOM][ACTIVE], theme,
+ "bottom-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.sides[SIDE_BOTTOM][INACTIVE], theme,
+ "bottom-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.corners[CORNER_TOP_LEFT][ACTIVE], theme,
+ "top-left-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.corners[CORNER_TOP_LEFT][INACTIVE], theme,
+ "top-left-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.corners[CORNER_TOP_RIGHT][ACTIVE], theme,
+ "top-right-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.corners[CORNER_TOP_RIGHT][INACTIVE], theme,
+ "top-right-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.corners[CORNER_BOTTOM_LEFT][ACTIVE], theme,
+ "bottom-left-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.corners[CORNER_BOTTOM_LEFT][INACTIVE], theme,
+ "bottom-left-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.corners[CORNER_BOTTOM_RIGHT][ACTIVE], theme,
+ "bottom-right-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.corners[CORNER_BOTTOM_RIGHT][INACTIVE], theme,
+ "bottom-right-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[HIDE_BUTTON][ACTIVE], theme,
+ "hide-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[HIDE_BUTTON][INACTIVE], theme,
+ "hide-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[HIDE_BUTTON][PRESSED], theme,
+ "hide-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[CLOSE_BUTTON][ACTIVE], theme,
+ "close-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[CLOSE_BUTTON][INACTIVE], theme,
+ "close-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[CLOSE_BUTTON][PRESSED], theme,
+ "close-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MAXIMIZE_BUTTON][ACTIVE], theme,
+ "maximize-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MAXIMIZE_BUTTON][INACTIVE], theme,
+ "maximize-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MAXIMIZE_BUTTON][PRESSED], theme,
+ "maximize-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[SHADE_BUTTON][ACTIVE], theme,
+ "shade-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[SHADE_BUTTON][INACTIVE], theme,
+ "shade-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[SHADE_BUTTON][PRESSED], theme,
+ "shade-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[STICK_BUTTON][ACTIVE], theme,
+ "stick-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[STICK_BUTTON][INACTIVE], theme,
+ "stick-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[STICK_BUTTON][PRESSED], theme,
+ "stick-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MENU_BUTTON][ACTIVE], theme,
+ "menu-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MENU_BUTTON][INACTIVE], theme,
+ "menu-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MENU_BUTTON][PRESSED], theme,
+ "menu-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[SHADE_BUTTON][T_ACTIVE], theme,
+ "shade-toggled-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[SHADE_BUTTON][T_INACTIVE], theme,
+ "shade-toggled-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[SHADE_BUTTON][T_PRESSED], theme,
+ "shade-toggled-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[STICK_BUTTON][T_ACTIVE], theme,
+ "stick-toggled-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[STICK_BUTTON][T_INACTIVE], theme,
+ "stick-toggled-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[STICK_BUTTON][T_PRESSED], theme,
+ "stick-toggled-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MAXIMIZE_BUTTON][T_ACTIVE], theme,
+ "maximize-toggled-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MAXIMIZE_BUTTON][T_INACTIVE], theme,
+ "maximize-toggled-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.buttons[MAXIMIZE_BUTTON][T_PRESSED], theme,
+ "maximize-toggled-pressed", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_1][ACTIVE], theme,
+ "title-1-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_1][INACTIVE], theme,
+ "title-1-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_2][ACTIVE], theme,
+ "title-2-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_2][INACTIVE], theme,
+ "title-2-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_3][ACTIVE], theme,
+ "title-3-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_3][INACTIVE], theme,
+ "title-3-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_4][ACTIVE], theme,
+ "title-4-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_4][INACTIVE], theme,
+ "title-4-inactive", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_5][ACTIVE], theme,
+ "title-5-active", colsym, 20);
+ myPixmapLoad (md->dpy, &params.title[TITLE_5][INACTIVE], theme,
+ "title-5-inactive", colsym, 20);
if (!g_ascii_strcasecmp ("left", getValue ("title_alignment", rc)))
{
- params.title_alignment = ALIGN_LEFT;
+ params.title_alignment = ALIGN_LEFT;
}
else if (!g_ascii_strcasecmp ("right", getValue ("title_alignment", rc)))
{
- params.title_alignment = ALIGN_RIGHT;
+ params.title_alignment = ALIGN_RIGHT;
}
else
{
- params.title_alignment = ALIGN_CENTER;
+ params.title_alignment = ALIGN_CENTER;
}
params.full_width_title =
- !g_ascii_strcasecmp ("true", getValue ("full_width_title", rc));
+ !g_ascii_strcasecmp ("true", getValue ("full_width_title", rc));
params.title_shadow[ACTIVE] =
- !g_ascii_strcasecmp ("true", getValue ("title_shadow_active", rc));
+ !g_ascii_strcasecmp ("true", getValue ("title_shadow_active", rc));
params.title_shadow[INACTIVE] =
- !g_ascii_strcasecmp ("true", getValue ("title_shadow_inactive", rc));
+ !g_ascii_strcasecmp ("true", getValue ("title_shadow_inactive", rc));
strncpy (params.button_layout, getValue ("button_layout", rc), 7);
params.button_spacing = TOINT (getValue ("button_spacing", rc));
params.button_offset = TOINT (getValue ("button_offset", rc));
params.title_vertical_offset_active =
- TOINT (getValue ("title_vertical_offset_active", rc));
+ TOINT (getValue ("title_vertical_offset_active", rc));
params.title_vertical_offset_inactive =
- TOINT (getValue ("title_vertical_offset_inactive", rc));
+ TOINT (getValue ("title_vertical_offset_inactive", rc));
params.title_horizontal_offset =
- TOINT (getValue ("title_horizontal_offset", rc));
+ TOINT (getValue ("title_horizontal_offset", rc));
- params.box_gc = createGC (cmap, "#FFFFFF", GXxor, NULL, 2, TRUE);
+ params.box_gc = createGC (md->cmap, "#FFFFFF", GXxor, NULL, 2, TRUE);
g_free (theme);
}
@@ -761,19 +761,19 @@ loadShortcutCmd (Settings rc[])
for (i = 0; i < NB_KEY_SHORTCUTS; i++)
{
- gchar *tmp, *shortcut;
- tmp = g_strdup_printf ("shortcut_%i_exec", i + 1);
- if (params.shortcut_exec[i])
- {
- g_free (params.shortcut_exec[i]);
- params.shortcut_exec[i] = NULL;
- }
- shortcut = getValue (tmp, rc);
- if (shortcut)
- {
- params.shortcut_exec[i] = g_strdup (shortcut);
- }
- g_free (tmp);
+ gchar *tmp, *shortcut;
+ tmp = g_strdup_printf ("shortcut_%i_exec", i + 1);
+ if (params.shortcut_exec[i])
+ {
+ g_free (params.shortcut_exec[i]);
+ params.shortcut_exec[i] = NULL;
+ }
+ shortcut = getValue (tmp, rc);
+ if (shortcut)
+ {
+ params.shortcut_exec[i] = g_strdup (shortcut);
+ }
+ g_free (tmp);
}
}
@@ -786,155 +786,155 @@ loadKeyBindings (Settings rc[])
keythemevalue = getValue ("keytheme", rc);
if (keythemevalue)
{
- keytheme = getThemeDir (keythemevalue, KEYTHEMERC);
- if (!parseRc (KEYTHEMERC, keytheme, rc))
- {
- g_warning (_("%s: specified key theme \"%s\" missing, using default"),
- progname, keythemevalue);
- g_free (keytheme);
- keytheme = getThemeDir (DEFAULT_KEYTHEME, KEYTHEMERC);
- parseRc (KEYTHEMERC, keytheme, rc);
- }
- g_free (keytheme);
-
- if (!checkRc (rc))
- {
- g_warning (_("%s: Missing values in defaults file"), progname);
- return FALSE;
- }
+ keytheme = getThemeDir (keythemevalue, KEYTHEMERC);
+ if (!parseRc (KEYTHEMERC, keytheme, rc))
+ {
+ g_warning (_("%s: specified key theme \"%s\" missing, using default"),
+ md->progname, keythemevalue);
+ g_free (keytheme);
+ keytheme = getThemeDir (DEFAULT_KEYTHEME, KEYTHEMERC);
+ parseRc (KEYTHEMERC, keytheme, rc);
+ }
+ g_free (keytheme);
+
+ if (!checkRc (rc))
+ {
+ g_warning (_("%s: Missing values in defaults file"), md->progname);
+ return FALSE;
+ }
}
loadShortcutCmd (rc);
- parseKeyString (dpy, &params.keys[KEY_MOVE_UP],
- getValue ("move_window_up_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_DOWN],
- getValue ("move_window_down_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_LEFT],
- getValue ("move_window_left_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_RIGHT],
- getValue ("move_window_right_key", rc));
- parseKeyString (dpy, &params.keys[KEY_RESIZE_UP],
- getValue ("resize_window_up_key", rc));
- parseKeyString (dpy, &params.keys[KEY_RESIZE_DOWN],
- getValue ("resize_window_down_key", rc));
- parseKeyString (dpy, &params.keys[KEY_RESIZE_LEFT],
- getValue ("resize_window_left_key", rc));
- parseKeyString (dpy, &params.keys[KEY_RESIZE_RIGHT],
- getValue ("resize_window_right_key", rc));
- parseKeyString (dpy, &params.keys[KEY_CYCLE_WINDOWS],
- getValue ("cycle_windows_key", rc));
- parseKeyString (dpy, &params.keys[KEY_CLOSE_WINDOW],
- getValue ("close_window_key", rc));
- parseKeyString (dpy, &params.keys[KEY_HIDE_WINDOW],
- getValue ("hide_window_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MAXIMIZE_WINDOW],
- getValue ("maximize_window_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MAXIMIZE_VERT],
- getValue ("maximize_vert_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MAXIMIZE_HORIZ],
- getValue ("maximize_horiz_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHADE_WINDOW],
- getValue ("shade_window_key", rc));
- parseKeyString (dpy, &params.keys[KEY_NEXT_WORKSPACE],
- getValue ("next_workspace_key", rc));
- parseKeyString (dpy, &params.keys[KEY_PREV_WORKSPACE],
- getValue ("prev_workspace_key", rc));
- parseKeyString (dpy, &params.keys[KEY_ADD_WORKSPACE],
- getValue ("add_workspace_key", rc));
- parseKeyString (dpy, &params.keys[KEY_DEL_WORKSPACE],
- getValue ("del_workspace_key", rc));
- parseKeyString (dpy, &params.keys[KEY_STICK_WINDOW],
- getValue ("stick_window_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_1],
- getValue ("workspace_1_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_2],
- getValue ("workspace_2_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_3],
- getValue ("workspace_3_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_4],
- getValue ("workspace_4_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_5],
- getValue ("workspace_5_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_6],
- getValue ("workspace_6_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_7],
- getValue ("workspace_7_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_8],
- getValue ("workspace_8_key", rc));
- parseKeyString (dpy, &params.keys[KEY_WORKSPACE_9],
- getValue ("workspace_9_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_NEXT_WORKSPACE],
- getValue ("move_window_next_workspace_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_PREV_WORKSPACE],
- getValue ("move_window_prev_workspace_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_1],
- getValue ("move_window_workspace_1_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_2],
- getValue ("move_window_workspace_2_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_3],
- getValue ("move_window_workspace_3_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_4],
- getValue ("move_window_workspace_4_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_5],
- getValue ("move_window_workspace_5_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_6],
- getValue ("move_window_workspace_6_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_7],
- getValue ("move_window_workspace_7_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_8],
- getValue ("move_window_workspace_8_key", rc));
- parseKeyString (dpy, &params.keys[KEY_MOVE_WORKSPACE_9],
- getValue ("move_window_workspace_9_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_1],
- getValue ("shortcut_1_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_2],
- getValue ("shortcut_2_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_3],
- getValue ("shortcut_3_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_4],
- getValue ("shortcut_4_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_5],
- getValue ("shortcut_5_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_6],
- getValue ("shortcut_6_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_7],
- getValue ("shortcut_7_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_8],
- getValue ("shortcut_8_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_9],
- getValue ("shortcut_9_key", rc));
- parseKeyString (dpy, &params.keys[KEY_SHORTCUT_10],
- getValue ("shortcut_10_key", rc));
- parseKeyString (dpy, &params.keys[KEY_RAISE_WINDOW],
- getValue ("raise_window_key", rc));
- parseKeyString (dpy, &params.keys[KEY_LOWER_WINDOW],
- getValue ("lower_window_key", rc));
- ungrabKeys (dpy, gnome_win);
- grabKey (dpy, &params.keys[KEY_CYCLE_WINDOWS], gnome_win);
- grabKey (dpy, &params.keys[KEY_NEXT_WORKSPACE], gnome_win);
- grabKey (dpy, &params.keys[KEY_PREV_WORKSPACE], gnome_win);
- grabKey (dpy, &params.keys[KEY_ADD_WORKSPACE], gnome_win);
- grabKey (dpy, &params.keys[KEY_NEXT_WORKSPACE], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_1], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_2], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_3], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_4], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_5], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_6], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_7], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_8], gnome_win);
- grabKey (dpy, &params.keys[KEY_WORKSPACE_9], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_1], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_2], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_3], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_4], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_5], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_6], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_7], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_8], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_9], gnome_win);
- grabKey (dpy, &params.keys[KEY_SHORTCUT_10], gnome_win);
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_UP],
+ getValue ("move_window_up_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_DOWN],
+ getValue ("move_window_down_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_LEFT],
+ getValue ("move_window_left_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_RIGHT],
+ getValue ("move_window_right_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_RESIZE_UP],
+ getValue ("resize_window_up_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_RESIZE_DOWN],
+ getValue ("resize_window_down_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_RESIZE_LEFT],
+ getValue ("resize_window_left_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_RESIZE_RIGHT],
+ getValue ("resize_window_right_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_CYCLE_WINDOWS],
+ getValue ("cycle_windows_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_CLOSE_WINDOW],
+ getValue ("close_window_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_HIDE_WINDOW],
+ getValue ("hide_window_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MAXIMIZE_WINDOW],
+ getValue ("maximize_window_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MAXIMIZE_VERT],
+ getValue ("maximize_vert_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MAXIMIZE_HORIZ],
+ getValue ("maximize_horiz_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHADE_WINDOW],
+ getValue ("shade_window_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_NEXT_WORKSPACE],
+ getValue ("next_workspace_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_PREV_WORKSPACE],
+ getValue ("prev_workspace_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_ADD_WORKSPACE],
+ getValue ("add_workspace_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_DEL_WORKSPACE],
+ getValue ("del_workspace_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_STICK_WINDOW],
+ getValue ("stick_window_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_1],
+ getValue ("workspace_1_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_2],
+ getValue ("workspace_2_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_3],
+ getValue ("workspace_3_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_4],
+ getValue ("workspace_4_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_5],
+ getValue ("workspace_5_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_6],
+ getValue ("workspace_6_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_7],
+ getValue ("workspace_7_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_8],
+ getValue ("workspace_8_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_WORKSPACE_9],
+ getValue ("workspace_9_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_NEXT_WORKSPACE],
+ getValue ("move_window_next_workspace_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_PREV_WORKSPACE],
+ getValue ("move_window_prev_workspace_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_1],
+ getValue ("move_window_workspace_1_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_2],
+ getValue ("move_window_workspace_2_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_3],
+ getValue ("move_window_workspace_3_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_4],
+ getValue ("move_window_workspace_4_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_5],
+ getValue ("move_window_workspace_5_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_6],
+ getValue ("move_window_workspace_6_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_7],
+ getValue ("move_window_workspace_7_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_8],
+ getValue ("move_window_workspace_8_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_MOVE_WORKSPACE_9],
+ getValue ("move_window_workspace_9_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_1],
+ getValue ("shortcut_1_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_2],
+ getValue ("shortcut_2_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_3],
+ getValue ("shortcut_3_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_4],
+ getValue ("shortcut_4_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_5],
+ getValue ("shortcut_5_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_6],
+ getValue ("shortcut_6_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_7],
+ getValue ("shortcut_7_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_8],
+ getValue ("shortcut_8_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_9],
+ getValue ("shortcut_9_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_SHORTCUT_10],
+ getValue ("shortcut_10_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_RAISE_WINDOW],
+ getValue ("raise_window_key", rc));
+ parseKeyString (md->dpy, &params.keys[KEY_LOWER_WINDOW],
+ getValue ("lower_window_key", rc));
+ ungrabKeys (md->dpy, md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_CYCLE_WINDOWS], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_NEXT_WORKSPACE], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_PREV_WORKSPACE], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_ADD_WORKSPACE], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_NEXT_WORKSPACE], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_1], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_2], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_3], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_4], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_5], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_6], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_7], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_8], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_WORKSPACE_9], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_1], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_2], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_3], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_4], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_5], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_6], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_7], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_8], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_9], md->gnome_win);
+ grabKey (md->dpy, &params.keys[KEY_SHORTCUT_10], md->gnome_win);
return TRUE;
}
@@ -943,128 +943,128 @@ gboolean
loadSettings (void)
{
Settings rc[] = {
- /* Do not chnage the order of the following parameters */
- {"active_text_color", NULL, FALSE},
- {"inactive_text_color", NULL, FALSE},
- {"active_border_color", NULL, FALSE},
- {"inactive_border_color", NULL, FALSE},
- {"active_color_1", NULL, FALSE},
- {"active_hilight_1", NULL, FALSE},
- {"active_shadow_1", NULL, FALSE},
- {"active_mid_1", NULL, FALSE},
- {"active_color_2", NULL, FALSE},
- {"active_hilight_2", NULL, FALSE},
- {"active_shadow_2", NULL, FALSE},
- {"active_mid_2", NULL, FALSE},
- {"inactive_color_1", NULL, FALSE},
- {"inactive_hilight_1", NULL, FALSE},
- {"inactive_shadow_1", NULL, FALSE},
- {"inactive_mid_1", NULL, FALSE},
- {"inactive_color_2", NULL, FALSE},
- {"inactive_hilight_2", NULL, FALSE},
- {"inactive_shadow_2", NULL, FALSE},
- {"inactive_mid_2", NULL, FALSE},
- /* You can change the order of the following parameters */
- {"box_move", NULL, TRUE},
- {"box_resize", NULL, TRUE},
- {"button_layout", NULL, TRUE},
- {"button_offset", NULL, TRUE},
- {"button_spacing", NULL, TRUE},
- {"click_to_focus", NULL, TRUE},
- {"cycle_minimum", NULL, FALSE},
- {"dbl_click_time", NULL, TRUE},
- {"double_click_action", NULL, TRUE},
- {"easy_click", NULL, FALSE},
- {"focus_hint", NULL, FALSE},
- {"focus_new", NULL, TRUE},
- {"full_width_title", NULL, TRUE},
- {"keytheme", NULL, TRUE},
- {"margin_left", NULL, FALSE},
- {"margin_right", NULL, FALSE},
- {"margin_bottom", NULL, FALSE},
- {"margin_top", NULL, FALSE},
- {"raise_delay", NULL, TRUE},
- {"raise_on_click", NULL, TRUE},
- {"raise_on_focus", NULL, TRUE},
- {"snap_to_border", NULL, TRUE},
- {"snap_to_windows", NULL, TRUE},
- {"snap_width", NULL, TRUE},
- {"theme", NULL, TRUE},
- {"title_alignment", NULL, TRUE},
- {"title_font", NULL, FALSE},
- {"title_horizontal_offset", NULL, TRUE},
- {"title_shadow_active", NULL, TRUE},
- {"title_shadow_inactive", NULL, TRUE},
- {"title_vertical_offset_active", NULL, TRUE},
- {"title_vertical_offset_inactive", NULL, TRUE},
- {"workspace_count", NULL, TRUE},
- {"wrap_windows", NULL, TRUE},
- {"wrap_workspaces", NULL, TRUE},
- {"wrap_resistance", NULL, TRUE},
- /* Keys */
- {"add_workspace_key", NULL, TRUE},
- {"close_window_key", NULL, TRUE},
- {"cycle_windows_key", NULL, TRUE},
- {"del_workspace_key", NULL, TRUE},
- {"hide_window_key", NULL, TRUE},
- {"maximize_horiz_key", NULL, TRUE},
- {"maximize_vert_key", NULL, TRUE},
- {"maximize_window_key", NULL, TRUE},
- {"move_window_down_key", NULL, TRUE},
- {"move_window_left_key", NULL, TRUE},
- {"move_window_next_workspace_key", NULL, TRUE},
- {"move_window_prev_workspace_key", NULL, TRUE},
- {"move_window_right_key", NULL, TRUE},
- {"move_window_up_key", NULL, TRUE},
- {"move_window_workspace_1_key", NULL, TRUE},
- {"move_window_workspace_2_key", NULL, TRUE},
- {"move_window_workspace_3_key", NULL, TRUE},
- {"move_window_workspace_4_key", NULL, TRUE},
- {"move_window_workspace_5_key", NULL, TRUE},
- {"move_window_workspace_6_key", NULL, TRUE},
- {"move_window_workspace_7_key", NULL, TRUE},
- {"move_window_workspace_8_key", NULL, TRUE},
- {"move_window_workspace_9_key", NULL, TRUE},
- {"next_workspace_key", NULL, TRUE},
- {"prev_workspace_key", NULL, TRUE},
- {"resize_window_down_key", NULL, TRUE},
- {"resize_window_left_key", NULL, TRUE},
- {"resize_window_right_key", NULL, TRUE},
- {"resize_window_up_key", NULL, TRUE},
- {"shade_window_key", NULL, TRUE},
- {"stick_window_key", NULL, TRUE},
- {"workspace_1_key", NULL, TRUE},
- {"workspace_2_key", NULL, TRUE},
- {"workspace_3_key", NULL, TRUE},
- {"workspace_4_key", NULL, TRUE},
- {"workspace_5_key", NULL, TRUE},
- {"workspace_6_key", NULL, TRUE},
- {"workspace_7_key", NULL, TRUE},
- {"workspace_8_key", NULL, TRUE},
- {"workspace_9_key", NULL, TRUE},
- {"shortcut_1_key", NULL, TRUE},
- {"shortcut_2_key", NULL, TRUE},
- {"shortcut_3_key", NULL, TRUE},
- {"shortcut_4_key", NULL, TRUE},
- {"shortcut_5_key", NULL, TRUE},
- {"shortcut_6_key", NULL, TRUE},
- {"shortcut_7_key", NULL, TRUE},
- {"shortcut_8_key", NULL, TRUE},
- {"shortcut_9_key", NULL, TRUE},
- {"shortcut_10_key", NULL, TRUE},
- {"shortcut_1_exec", NULL, FALSE},
- {"shortcut_2_exec", NULL, FALSE},
- {"shortcut_3_exec", NULL, FALSE},
- {"shortcut_4_exec", NULL, FALSE},
- {"shortcut_5_exec", NULL, FALSE},
- {"shortcut_6_exec", NULL, FALSE},
- {"shortcut_7_exec", NULL, FALSE},
- {"shortcut_8_exec", NULL, FALSE},
- {"shortcut_9_exec", NULL, FALSE},
- {"shortcut_10_exec", NULL, FALSE},
- {"raise_window_key", NULL, TRUE},
- {"lower_window_key", NULL, TRUE},
- {NULL, NULL, FALSE}
+ /* Do not chnage the order of the following parameters */
+ {"active_text_color", NULL, FALSE},
+ {"inactive_text_color", NULL, FALSE},
+ {"active_border_color", NULL, FALSE},
+ {"inactive_border_color", NULL, FALSE},
+ {"active_color_1", NULL, FALSE},
+ {"active_hilight_1", NULL, FALSE},
+ {"active_shadow_1", NULL, FALSE},
+ {"active_mid_1", NULL, FALSE},
+ {"active_color_2", NULL, FALSE},
+ {"active_hilight_2", NULL, FALSE},
+ {"active_shadow_2", NULL, FALSE},
+ {"active_mid_2", NULL, FALSE},
+ {"inactive_color_1", NULL, FALSE},
+ {"inactive_hilight_1", NULL, FALSE},
+ {"inactive_shadow_1", NULL, FALSE},
+ {"inactive_mid_1", NULL, FALSE},
+ {"inactive_color_2", NULL, FALSE},
+ {"inactive_hilight_2", NULL, FALSE},
+ {"inactive_shadow_2", NULL, FALSE},
+ {"inactive_mid_2", NULL, FALSE},
+ /* You can change the order of the following parameters */
+ {"box_move", NULL, TRUE},
+ {"box_resize", NULL, TRUE},
+ {"button_layout", NULL, TRUE},
+ {"button_offset", NULL, TRUE},
+ {"button_spacing", NULL, TRUE},
+ {"click_to_focus", NULL, TRUE},
+ {"cycle_minimum", NULL, FALSE},
+ {"dbl_click_time", NULL, TRUE},
+ {"double_click_action", NULL, TRUE},
+ {"easy_click", NULL, FALSE},
+ {"focus_hint", NULL, FALSE},
+ {"focus_new", NULL, TRUE},
+ {"full_width_title", NULL, TRUE},
+ {"keytheme", NULL, TRUE},
+ {"margin_left", NULL, FALSE},
+ {"margin_right", NULL, FALSE},
+ {"margin_bottom", NULL, FALSE},
+ {"margin_top", NULL, FALSE},
+ {"raise_delay", NULL, TRUE},
+ {"raise_on_click", NULL, TRUE},
+ {"raise_on_focus", NULL, TRUE},
+ {"snap_to_border", NULL, TRUE},
+ {"snap_to_windows", NULL, TRUE},
+ {"snap_width", NULL, TRUE},
+ {"theme", NULL, TRUE},
+ {"title_alignment", NULL, TRUE},
+ {"title_font", NULL, FALSE},
+ {"title_horizontal_offset", NULL, TRUE},
+ {"title_shadow_active", NULL, TRUE},
+ {"title_shadow_inactive", NULL, TRUE},
+ {"title_vertical_offset_active", NULL, TRUE},
+ {"title_vertical_offset_inactive", NULL, TRUE},
+ {"workspace_count", NULL, TRUE},
+ {"wrap_windows", NULL, TRUE},
+ {"wrap_workspaces", NULL, TRUE},
+ {"wrap_resistance", NULL, TRUE},
+ /* Keys */
+ {"add_workspace_key", NULL, TRUE},
+ {"close_window_key", NULL, TRUE},
+ {"cycle_windows_key", NULL, TRUE},
+ {"del_workspace_key", NULL, TRUE},
+ {"hide_window_key", NULL, TRUE},
+ {"maximize_horiz_key", NULL, TRUE},
+ {"maximize_vert_key", NULL, TRUE},
+ {"maximize_window_key", NULL, TRUE},
+ {"move_window_down_key", NULL, TRUE},
+ {"move_window_left_key", NULL, TRUE},
+ {"move_window_next_workspace_key", NULL, TRUE},
+ {"move_window_prev_workspace_key", NULL, TRUE},
+ {"move_window_right_key", NULL, TRUE},
+ {"move_window_up_key", NULL, TRUE},
+ {"move_window_workspace_1_key", NULL, TRUE},
+ {"move_window_workspace_2_key", NULL, TRUE},
+ {"move_window_workspace_3_key", NULL, TRUE},
+ {"move_window_workspace_4_key", NULL, TRUE},
+ {"move_window_workspace_5_key", NULL, TRUE},
+ {"move_window_workspace_6_key", NULL, TRUE},
+ {"move_window_workspace_7_key", NULL, TRUE},
+ {"move_window_workspace_8_key", NULL, TRUE},
+ {"move_window_workspace_9_key", NULL, TRUE},
+ {"next_workspace_key", NULL, TRUE},
+ {"prev_workspace_key", NULL, TRUE},
+ {"resize_window_down_key", NULL, TRUE},
+ {"resize_window_left_key", NULL, TRUE},
+ {"resize_window_right_key", NULL, TRUE},
+ {"resize_window_up_key", NULL, TRUE},
+ {"shade_window_key", NULL, TRUE},
+ {"stick_window_key", NULL, TRUE},
+ {"workspace_1_key", NULL, TRUE},
+ {"workspace_2_key", NULL, TRUE},
+ {"workspace_3_key", NULL, TRUE},
+ {"workspace_4_key", NULL, TRUE},
+ {"workspace_5_key", NULL, TRUE},
+ {"workspace_6_key", NULL, TRUE},
+ {"workspace_7_key", NULL, TRUE},
+ {"workspace_8_key", NULL, TRUE},
+ {"workspace_9_key", NULL, TRUE},
+ {"shortcut_1_key", NULL, TRUE},
+ {"shortcut_2_key", NULL, TRUE},
+ {"shortcut_3_key", NULL, TRUE},
+ {"shortcut_4_key", NULL, TRUE},
+ {"shortcut_5_key", NULL, TRUE},
+ {"shortcut_6_key", NULL, TRUE},
+ {"shortcut_7_key", NULL, TRUE},
+ {"shortcut_8_key", NULL, TRUE},
+ {"shortcut_9_key", NULL, TRUE},
+ {"shortcut_10_key", NULL, TRUE},
+ {"shortcut_1_exec", NULL, FALSE},
+ {"shortcut_2_exec", NULL, FALSE},
+ {"shortcut_3_exec", NULL, FALSE},
+ {"shortcut_4_exec", NULL, FALSE},
+ {"shortcut_5_exec", NULL, FALSE},
+ {"shortcut_6_exec", NULL, FALSE},
+ {"shortcut_7_exec", NULL, FALSE},
+ {"shortcut_8_exec", NULL, FALSE},
+ {"shortcut_9_exec", NULL, FALSE},
+ {"shortcut_10_exec", NULL, FALSE},
+ {"raise_window_key", NULL, TRUE},
+ {"lower_window_key", NULL, TRUE},
+ {NULL, NULL, FALSE}
};
GValue tmp_val = { 0, };
@@ -1076,85 +1076,84 @@ loadSettings (void)
if (!loadKeyBindings (rc))
{
- freeRc (rc);
- return FALSE;
+ freeRc (rc);
+ return FALSE;
}
params.box_resize =
- !g_ascii_strcasecmp ("true", getValue ("box_resize", rc));
+ !g_ascii_strcasecmp ("true", getValue ("box_resize", rc));
params.box_move = !g_ascii_strcasecmp ("true", getValue ("box_move", rc));
params.click_to_focus =
- !g_ascii_strcasecmp ("true", getValue ("click_to_focus", rc));
+ !g_ascii_strcasecmp ("true", getValue ("click_to_focus", rc));
params.easy_click =
- !g_ascii_strcasecmp ("true", getValue ("easy_click", rc));
+ !g_ascii_strcasecmp ("true", getValue ("easy_click", rc));
params.cycle_minimum =
- !g_ascii_strcasecmp ("true", getValue ("cycle_minimum", rc));
+ !g_ascii_strcasecmp ("true", getValue ("cycle_minimum", rc));
params.focus_hint =
- !g_ascii_strcasecmp ("true", getValue ("focus_hint", rc));
+ !g_ascii_strcasecmp ("true", getValue ("focus_hint", rc));
params.focus_new =
- !g_ascii_strcasecmp ("true", getValue ("focus_new", rc));
+ !g_ascii_strcasecmp ("true", getValue ("focus_new", rc));
params.raise_on_focus =
- !g_ascii_strcasecmp ("true", getValue ("raise_on_focus", rc));
+ !g_ascii_strcasecmp ("true", getValue ("raise_on_focus", rc));
params.raise_delay = abs (TOINT (getValue ("raise_delay", rc)));
params.raise_on_click =
- !g_ascii_strcasecmp ("true", getValue ("raise_on_click", rc));
+ !g_ascii_strcasecmp ("true", getValue ("raise_on_click", rc));
params.snap_to_border =
- !g_ascii_strcasecmp ("true", getValue ("snap_to_border", rc));
+ !g_ascii_strcasecmp ("true", getValue ("snap_to_border", rc));
params.snap_to_windows =
- !g_ascii_strcasecmp ("true", getValue ("snap_to_windows", rc));
+ !g_ascii_strcasecmp ("true", getValue ("snap_to_windows", rc));
params.snap_width = abs (TOINT (getValue ("snap_width", rc)));
params.dbl_click_time = abs (TOINT (getValue ("dbl_click_time", rc)));
- set_settings_margin (LEFT, TOINT (getValue ("margin_left", rc)));
- set_settings_margin (RIGHT, TOINT (getValue ("margin_right", rc)));
- set_settings_margin (BOTTOM, TOINT (getValue ("margin_bottom",
- rc)));
- set_settings_margin (TOP, TOINT (getValue ("margin_top", rc)));
+ set_settings_margin (LEFT, TOINT (getValue ("margin_left", rc)));
+ set_settings_margin (RIGHT, TOINT (getValue ("margin_right", rc)));
+ set_settings_margin (BOTTOM, TOINT (getValue ("margin_bottom", rc)));
+ set_settings_margin (TOP, TOINT (getValue ("margin_top", rc)));
g_value_init (&tmp_val, G_TYPE_INT);
if (gdk_setting_get ("gtk-double-click-time", &tmp_val))
{
- params.dbl_click_time = abs (g_value_get_int (&tmp_val));
+ params.dbl_click_time = abs (g_value_get_int (&tmp_val));
}
if (!g_ascii_strcasecmp ("shade", getValue ("double_click_action", rc)))
{
- params.double_click_action = ACTION_SHADE;
+ params.double_click_action = ACTION_SHADE;
}
else if (!g_ascii_strcasecmp ("hide", getValue ("double_click_action",
- rc)))
+ rc)))
{
- params.double_click_action = ACTION_HIDE;
+ params.double_click_action = ACTION_HIDE;
}
else if (!g_ascii_strcasecmp ("maximize", getValue ("double_click_action",
- rc)))
+ rc)))
{
- params.double_click_action = ACTION_MAXIMIZE;
+ params.double_click_action = ACTION_MAXIMIZE;
}
else
{
- params.double_click_action = ACTION_NONE;
+ params.double_click_action = ACTION_NONE;
}
if (params.workspace_count < 0)
{
- gint workspace_count;
- workspace_count = abs (TOINT (getValue ("workspace_count", rc)));
- if (workspace_count < 0)
- {
- workspace_count = 0;
- }
- g_message (_("%s: Workspace count not set, using rc value: %i"),
- g_get_prgname (), workspace_count);
- workspaceSetCount (workspace_count);
+ gint workspace_count;
+ workspace_count = abs (TOINT (getValue ("workspace_count", rc)));
+ if (workspace_count < 0)
+ {
+ workspace_count = 0;
+ }
+ g_message (_("%s: Workspace count not set, using rc value: %i"),
+ g_get_prgname (), workspace_count);
+ workspaceSetCount (workspace_count);
}
params.wrap_workspaces =
- !g_ascii_strcasecmp ("true", getValue ("wrap_workspaces", rc));
+ !g_ascii_strcasecmp ("true", getValue ("wrap_workspaces", rc));
params.wrap_windows =
- !g_ascii_strcasecmp ("true", getValue ("wrap_windows", rc));
+ !g_ascii_strcasecmp ("true", getValue ("wrap_windows", rc));
params.wrap_resistance = abs (TOINT (getValue ("wrap_resistance", rc)));
freeRc (rc);
@@ -1169,32 +1168,32 @@ unloadTheme (void)
for (i = 0; i < 3; i++)
{
- myPixmapFree (dpy, &params.sides[i][ACTIVE]);
- myPixmapFree (dpy, &params.sides[i][INACTIVE]);
+ myPixmapFree (md->dpy, &params.sides[i][ACTIVE]);
+ myPixmapFree (md->dpy, &params.sides[i][INACTIVE]);
}
for (i = 0; i < 4; i++)
{
- myPixmapFree (dpy, &params.corners[i][ACTIVE]);
- myPixmapFree (dpy, &params.corners[i][INACTIVE]);
+ myPixmapFree (md->dpy, &params.corners[i][ACTIVE]);
+ myPixmapFree (md->dpy, &params.corners[i][INACTIVE]);
}
for (i = 0; i < BUTTON_COUNT; i++)
{
- myPixmapFree (dpy, &params.buttons[i][ACTIVE]);
- myPixmapFree (dpy, &params.buttons[i][INACTIVE]);
- myPixmapFree (dpy, &params.buttons[i][PRESSED]);
- myPixmapFree (dpy, &params.buttons[i][T_ACTIVE]);
- myPixmapFree (dpy, &params.buttons[i][T_INACTIVE]);
- myPixmapFree (dpy, &params.buttons[i][T_PRESSED]);
+ myPixmapFree (md->dpy, &params.buttons[i][ACTIVE]);
+ myPixmapFree (md->dpy, &params.buttons[i][INACTIVE]);
+ myPixmapFree (md->dpy, &params.buttons[i][PRESSED]);
+ myPixmapFree (md->dpy, &params.buttons[i][T_ACTIVE]);
+ myPixmapFree (md->dpy, &params.buttons[i][T_INACTIVE]);
+ myPixmapFree (md->dpy, &params.buttons[i][T_PRESSED]);
}
for (i = 0; i < 5; i++)
{
- myPixmapFree (dpy, &params.title[i][ACTIVE]);
- myPixmapFree (dpy, &params.title[i][INACTIVE]);
+ myPixmapFree (md->dpy, &params.title[i][ACTIVE]);
+ myPixmapFree (md->dpy, &params.title[i][INACTIVE]);
}
if (params.box_gc != None)
{
- XFreeGC (dpy, params.box_gc);
- params.box_gc = None;
+ XFreeGC (md->dpy, params.box_gc);
+ params.box_gc = None;
}
}
@@ -1206,11 +1205,11 @@ reloadSettings (int mask)
unloadTheme ();
if (!loadSettings ())
{
- return FALSE;
+ return FALSE;
}
if (mask)
{
- clientUpdateAllFrames (mask);
+ clientUpdateAllFrames (mask);
}
return TRUE;
@@ -1237,72 +1236,72 @@ initSettings (void)
for (i = 0; i < NB_KEY_SHORTCUTS; i++)
{
- params.shortcut_exec[i] = NULL;
+ params.shortcut_exec[i] = NULL;
}
for (i = 0; i < 3; i++)
{
- myPixmapInit (&params.sides[i][ACTIVE]);
- myPixmapInit (&params.sides[i][INACTIVE]);
+ myPixmapInit (&params.sides[i][ACTIVE]);
+ myPixmapInit (&params.sides[i][INACTIVE]);
}
for (i = 0; i < 4; i++)
{
- myPixmapInit (&params.corners[i][ACTIVE]);
- myPixmapInit (&params.corners[i][INACTIVE]);
+ myPixmapInit (&params.corners[i][ACTIVE]);
+ myPixmapInit (&params.corners[i][INACTIVE]);
}
for (i = 0; i < BUTTON_COUNT; i++)
{
- myPixmapInit (&params.buttons[i][ACTIVE]);
- myPixmapInit (&params.buttons[i][INACTIVE]);
- myPixmapInit (&params.buttons[i][PRESSED]);
- myPixmapInit (&params.buttons[i][T_ACTIVE]);
- myPixmapInit (&params.buttons[i][T_INACTIVE]);
- myPixmapInit (&params.buttons[i][T_PRESSED]);
+ myPixmapInit (&params.buttons[i][ACTIVE]);
+ myPixmapInit (&params.buttons[i][INACTIVE]);
+ myPixmapInit (&params.buttons[i][PRESSED]);
+ myPixmapInit (&params.buttons[i][T_ACTIVE]);
+ myPixmapInit (&params.buttons[i][T_INACTIVE]);
+ myPixmapInit (&params.buttons[i][T_PRESSED]);
}
for (i = 0; i < 5; i++)
{
- myPixmapInit (&params.title[i][ACTIVE]);
- myPixmapInit (&params.title[i][INACTIVE]);
+ myPixmapInit (&params.title[i][ACTIVE]);
+ myPixmapInit (&params.title[i][INACTIVE]);
}
- if (!mcs_client_check_manager (dpy, screen, "xfce-mcs-manager"))
+ if (!mcs_client_check_manager (md->dpy, md->screen, "xfce-mcs-manager"))
{
- g_warning ("MCS manager not running");
+ g_warning ("MCS manager not running");
}
- client = mcs_client_new (dpy, screen, notify_cb, watch_cb, NULL);
+ client = mcs_client_new (md->dpy, md->screen, notify_cb, watch_cb, NULL);
if (client)
{
- mcs_client_add_channel (client, CHANNEL1);
- mcs_client_add_channel (client, CHANNEL2);
- mcs_client_add_channel (client, CHANNEL3);
+ mcs_client_add_channel (client, CHANNEL1);
+ mcs_client_add_channel (client, CHANNEL2);
+ mcs_client_add_channel (client, CHANNEL3);
}
else
{
- g_warning ("Cannot create MCS client channel");
+ g_warning ("Cannot create MCS client channel");
}
mcs_initted = TRUE;
- if (getHint (dpy, root, net_number_of_desktops, &val))
+ if (getHint (md->dpy, md->xroot, net_number_of_desktops, &val))
{
- workspaceSetCount (val);
+ workspaceSetCount (val);
}
- else if (getHint (dpy, root, win_workspace_count, &val))
+ else if (getHint (md->dpy, md->xroot, win_workspace_count, &val))
{
- workspaceSetCount (val);
+ workspaceSetCount (val);
}
- if (getUTF8String (dpy, root, net_desktop_names, &names, &i))
+ if (getUTF8String (md->dpy, md->xroot, net_desktop_names, &names, &i))
{
- workspaceSetNames (names, i);
+ workspaceSetNames (names, i);
}
else
{
- params.workspace_names = NULL;
- params.workspace_names_length = 0;
+ params.workspace_names = NULL;
+ params.workspace_names_length = 0;
}
if (!loadSettings ())
{
- return FALSE;
+ return FALSE;
}
placeSidewalks (params.wrap_workspaces);
diff --git a/src/settings.h b/src/settings.h
index da1e6123f..8fd717c4e 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -111,8 +111,8 @@
#define KEY_SHORTCUT_8 47
#define KEY_SHORTCUT_9 48
#define KEY_SHORTCUT_10 49
-#define KEY_LOWER_WINDOW 50
-#define KEY_RAISE_WINDOW 51
+#define KEY_LOWER_WINDOW 50
+#define KEY_RAISE_WINDOW 51
#define KEY_COUNT 52
#define NB_KEY_SHORTCUTS 10
diff --git a/src/spinning_cursor.c b/src/spinning_cursor.c
index 5227f1ba6..fbf88dfde 100644
--- a/src/spinning_cursor.c
+++ b/src/spinning_cursor.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- mozilla - (c) 1998 mozilla.org
- xfwm4 - (c) 2003 Olivier Fourdan
+ mozilla - (c) 1998 mozilla.org
+ xfwm4 - (c) 2003 Olivier Fourdan
*/
@@ -23,7 +23,6 @@
#endif
#include <X11/Xlib.h>
-#include "main.h"
static const unsigned char xlib_spinning_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
@@ -74,11 +73,11 @@ cursorCreateSpinning (Display * dpy, Window window)
bg.flags = 0xf;
cursor =
- XCreatePixmapFromBitmapData (dpy, window, (char *) xlib_spinning_bits,
- 32, 32, 0xffffffff, 0x0, 1);
+ XCreatePixmapFromBitmapData (dpy, window, (char *) xlib_spinning_bits,
+ 32, 32, 0xffffffff, 0x0, 1);
mask =
- XCreatePixmapFromBitmapData (dpy, window,
- (char *) xlib_spinning_mask_bits, 32, 32, 0xffffffff, 0x0, 1);
+ XCreatePixmapFromBitmapData (dpy, window,
+ (char *) xlib_spinning_mask_bits, 32, 32, 0xffffffff, 0x0, 1);
xcursor = XCreatePixmapCursor (dpy, cursor, mask, &fg, &bg, 2, 2);
XFreePixmap (dpy, mask);
XFreePixmap (dpy, cursor);
diff --git a/src/spinning_cursor.h b/src/spinning_cursor.h
index dd75fe530..98acc02ca 100644
--- a/src/spinning_cursor.h
+++ b/src/spinning_cursor.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- Metacity - (c) 2003 Havoc Pennington
- xfwm4 - (c) 2003 Olivier Fourdan
+ Metacity - (c) 2003 Havoc Pennington
+ xfwm4 - (c) 2003 Olivier Fourdan
*/
diff --git a/src/stacking.c b/src/stacking.c
index 8691fcea9..106ad4a5e 100644
--- a/src/stacking.c
+++ b/src/stacking.c
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
@@ -46,23 +46,23 @@ clientApplyStackList (void)
nwindows = g_list_length (windows_stack);
xwinstack = g_new (Window, nwindows + 2);
- xwinstack[i++] = sidewalk[0];
- xwinstack[i++] = sidewalk[1];
+ xwinstack[i++] = md->sidewalk[0];
+ xwinstack[i++] = md->sidewalk[1];
if (nwindows)
{
- GList *index;
- Client *c;
-
- for (index = g_list_last(windows_stack); index; index = g_list_previous (index))
- {
- c = (Client *) index->data;
- xwinstack[i++] = c->frame;
- DBG (" [%i] \"%s\" (0x%lx)", i, c->name, c->window);
- }
+ GList *index;
+ Client *c;
+
+ for (index = g_list_last(windows_stack); index; index = g_list_previous (index))
+ {
+ c = (Client *) index->data;
+ xwinstack[i++] = c->frame;
+ DBG (" [%i] \"%s\" (0x%lx)", i, c->name, c->window);
+ }
}
- XRestackWindows (dpy, xwinstack, (int) nwindows + 2);
+ XRestackWindows (md->dpy, xwinstack, (int) nwindows + 2);
g_free (xwinstack);
}
@@ -79,19 +79,19 @@ clientTransientOrModalHasAncestor (Client * c, int ws)
if (!clientIsTransientOrModal (c))
{
- return FALSE;
+ return FALSE;
}
for (index = windows_stack; index; index = g_list_next (index))
{
- c2 = (Client *) index->data;
- if ((c2 != c) && !clientIsTransientOrModal (c2)
- && clientIsTransientOrModalFor (c, c2)
- && !FLAG_TEST (c2->flags, CLIENT_FLAG_HIDDEN)
- && (c2->win_workspace == ws))
- {
- return TRUE;
- }
+ c2 = (Client *) index->data;
+ if ((c2 != c) && !clientIsTransientOrModal (c2)
+ && clientIsTransientOrModalFor (c, c2)
+ && !FLAG_TEST (c2->flags, CLIENT_FLAG_HIDDEN)
+ && (c2->win_workspace == ws))
+ {
+ return TRUE;
+ }
}
return FALSE;
@@ -109,12 +109,12 @@ clientGetLowestTransient (Client * c)
for (index = windows_stack; index; index = g_list_next (index))
{
- c2 = (Client *) index->data;
- if ((c2 != c) && clientIsTransientFor (c2, c))
- {
- lowest_transient = c2;
- break;
- }
+ c2 = (Client *) index->data;
+ if ((c2 != c) && clientIsTransientFor (c2, c))
+ {
+ lowest_transient = c2;
+ break;
+ }
}
return lowest_transient;
}
@@ -131,14 +131,14 @@ clientGetHighestTransientOrModalFor (Client * c)
for (index = windows_stack; index; index = g_list_next (index))
{
- c2 = (Client *) index->data;
- if (c2)
- {
- if (clientIsTransientOrModalFor (c, c2))
- {
- highest_transient = c2;
- }
- }
+ c2 = (Client *) index->data;
+ if (c2)
+ {
+ if (clientIsTransientOrModalFor (c, c2))
+ {
+ highest_transient = c2;
+ }
+ }
}
return highest_transient;
@@ -156,14 +156,14 @@ clientGetTopMostForGroup (Client * c)
for (index = windows_stack; index; index = g_list_next (index))
{
- c2 = (Client *) index->data;
- if (c2 != c)
- {
- if (clientSameGroup (c, c2))
- {
- top_most = c2;
- }
- }
+ c2 = (Client *) index->data;
+ if (c2 != c)
+ {
+ if (clientSameGroup (c, c2))
+ {
+ top_most = c2;
+ }
+ }
}
return top_most;
@@ -179,17 +179,17 @@ clientGetNextTopMost (int layer, Client * exclude)
for (index = windows_stack; index; index = g_list_next (index))
{
- c = (Client *) index->data;
- TRACE ("*** stack window \"%s\" (0x%lx), layer %i", c->name,
- c->window, (int) c->win_layer);
- if (!exclude || (c != exclude))
- {
- if (c->win_layer > layer)
- {
- top = c;
- break;
- }
- }
+ c = (Client *) index->data;
+ TRACE ("*** stack window \"%s\" (0x%lx), layer %i", c->name,
+ c->window, (int) c->win_layer);
+ if (!exclude || (c != exclude))
+ {
+ if (c->win_layer > layer)
+ {
+ top = c;
+ break;
+ }
+ }
}
return top;
@@ -205,23 +205,23 @@ clientGetBottomMost (int layer, Client * exclude)
for (index = windows_stack; index; index = g_list_next (index))
{
- c = (Client *) index->data;
- if (c)
- {
- TRACE ("*** stack window \"%s\" (0x%lx), layer %i", c->name,
- c->window, (int) c->win_layer);
- if (!exclude || (c != exclude))
- {
- if (c->win_layer < layer)
- {
- bot = c;
- }
- else if (c->win_layer >= layer)
- {
- break;
- }
- }
- }
+ c = (Client *) index->data;
+ if (c)
+ {
+ TRACE ("*** stack window \"%s\" (0x%lx), layer %i", c->name,
+ c->window, (int) c->win_layer);
+ if (!exclude || (c != exclude))
+ {
+ if (c->win_layer < layer)
+ {
+ bot = c;
+ }
+ else if (c->win_layer >= layer)
+ {
+ break;
+ }
+ }
+ }
}
return bot;
}
@@ -240,16 +240,16 @@ clientAtPosition (int x, int y, Client * exclude)
for (index = g_list_last (windows_stack); index; index = g_list_previous (index))
{
- c2 = (Client *) index->data;
- if (clientSelectMask (c2, 0) && (c2 != exclude))
- {
- if ((frameX (c2) < x) && (frameX (c2) + frameWidth (c2) > x)
- && (frameY (c2) < y) && (frameY (c2) + frameHeight (c2) > y))
- {
- c = c2;
- break;
- }
- }
+ c2 = (Client *) index->data;
+ if (clientSelectMask (c2, 0) && (c2 != exclude))
+ {
+ if ((frameX (c2) < x) && (frameX (c2) + frameWidth (c2) > x)
+ && (frameY (c2) < y) && (frameY (c2) + frameHeight (c2) > y))
+ {
+ c = c2;
+ break;
+ }
+ }
}
return c;
@@ -263,112 +263,112 @@ clientRaise (Client * c)
if (c == last_raise)
{
- TRACE ("client \"%s\" (0x%lx) already raised", c->name, c->window);
- return;
+ TRACE ("client \"%s\" (0x%lx) already raised", c->name, c->window);
+ return;
}
TRACE ("raising client \"%s\" (0x%lx)", c->name, c->window);
if (g_list_length (windows_stack) < 1)
{
- return;
+ return;
}
if (FLAG_TEST (c->flags, CLIENT_FLAG_MANAGED))
{
- Client *c2, *c3;
- Client *client_sibling = NULL;
- GList *transients = NULL;
- GList *sibling = NULL;
- GList *index1, *index2;
- GList *windows_stack_copy;
-
- /* Copy the existing window stack temporarily as reference */
- windows_stack_copy = g_list_copy (windows_stack);
- /* Search for the window that will be just on top of the raised window (layers...) */
- client_sibling = clientGetNextTopMost (c->win_layer, c);
- windows_stack = g_list_remove (windows_stack, (gconstpointer) c);
- if (client_sibling)
- {
- /* If there is one, look for its place in the list */
- sibling = g_list_find (windows_stack, (gconstpointer) client_sibling);
- /* Place the raised window just before it */
- windows_stack = g_list_insert_before (windows_stack, sibling, c);
- }
- else
- {
- /* There will be no window on top of the raised window, so place it at the end of list */
- windows_stack = g_list_append (windows_stack, c);
- }
- /* Now, look for transients, transients of transients, etc. */
- for (index1 = windows_stack_copy; index1; index1 = g_list_next (index1))
- {
- c2 = (Client *) index1->data;
- if (c2)
- {
- if ((c2 != c) && clientIsTransientOrModalFor (c2, c))
- {
- transients = g_list_append (transients, c2);
- if (sibling)
- {
- /* Make sure client_sibling is not c2 otherwise we create a circular linked list */
- if (client_sibling != c2)
- {
- /* Place the transient window just before sibling */
- windows_stack = g_list_remove (windows_stack, (gconstpointer) c2);
- windows_stack = g_list_insert_before (windows_stack, sibling, c2);
- }
- }
- else
- {
- /* There will be no window on top of the transient window, so place it at the end of list */
- windows_stack = g_list_remove (windows_stack, (gconstpointer) c2);
- windows_stack = g_list_append (windows_stack, c2);
- }
- }
- else
- {
- for (index2 = transients; index2; index2 = g_list_next (index2))
- {
- c3 = (Client *) index2->data;
- if ((c3 != c2) && clientIsTransientOrModalFor (c2, c3))
- {
- transients = g_list_append (transients, c2);
- if (sibling)
- {
- /* Again, make sure client_sibling is not c2 to avoid a circular linked list */
- if (client_sibling != c2)
- {
- /* Place the transient window just before sibling */
- windows_stack = g_list_remove (windows_stack, (gconstpointer) c2);
- windows_stack = g_list_insert_before (windows_stack, sibling, c2);
- }
- }
- else
- {
- /* There will be no window on top of the transient window, so place it at the end of list */
- windows_stack = g_list_remove (windows_stack, (gconstpointer) c2);
- windows_stack = g_list_append (windows_stack, c2);
- }
- break;
- }
- }
- }
- }
- }
- if (transients)
- {
- g_list_free (transients);
- }
- if (windows_stack_copy)
- {
- g_list_free (windows_stack_copy);
- }
- /* Now, windows_stack contains the correct window stack
- We still need to tell the X Server to reflect the changes
- */
- clientApplyStackList ();
- clientSetNetClientList (net_client_list_stacking, windows_stack);
- last_raise = c;
+ Client *c2, *c3;
+ Client *client_sibling = NULL;
+ GList *transients = NULL;
+ GList *sibling = NULL;
+ GList *index1, *index2;
+ GList *windows_stack_copy;
+
+ /* Copy the existing window stack temporarily as reference */
+ windows_stack_copy = g_list_copy (windows_stack);
+ /* Search for the window that will be just on top of the raised window (layers...) */
+ client_sibling = clientGetNextTopMost (c->win_layer, c);
+ windows_stack = g_list_remove (windows_stack, (gconstpointer) c);
+ if (client_sibling)
+ {
+ /* If there is one, look for its place in the list */
+ sibling = g_list_find (windows_stack, (gconstpointer) client_sibling);
+ /* Place the raised window just before it */
+ windows_stack = g_list_insert_before (windows_stack, sibling, c);
+ }
+ else
+ {
+ /* There will be no window on top of the raised window, so place it at the end of list */
+ windows_stack = g_list_append (windows_stack, c);
+ }
+ /* Now, look for transients, transients of transients, etc. */
+ for (index1 = windows_stack_copy; index1; index1 = g_list_next (index1))
+ {
+ c2 = (Client *) index1->data;
+ if (c2)
+ {
+ if ((c2 != c) && clientIsTransientOrModalFor (c2, c))
+ {
+ transients = g_list_append (transients, c2);
+ if (sibling)
+ {
+ /* Make sure client_sibling is not c2 otherwise we create a circular linked list */
+ if (client_sibling != c2)
+ {
+ /* Place the transient window just before sibling */
+ windows_stack = g_list_remove (windows_stack, (gconstpointer) c2);
+ windows_stack = g_list_insert_before (windows_stack, sibling, c2);
+ }
+ }
+ else
+ {
+ /* There will be no window on top of the transient window, so place it at the end of list */
+ windows_stack = g_list_remove (windows_stack, (gconstpointer) c2);
+ windows_stack = g_list_append (windows_stack, c2);
+ }
+ }
+ else
+ {
+ for (index2 = transients; index2; index2 = g_list_next (index2))
+ {
+ c3 = (Client *) index2->data;
+ if ((c3 != c2) && clientIsTransientOrModalFor (c2, c3))
+ {
+ transients = g_list_append (transients, c2);
+ if (sibling)
+ {
+ /* Again, make sure client_sibling is not c2 to avoid a circular linked list */
+ if (client_sibling != c2)
+ {
+ /* Place the transient window just before sibling */
+ windows_stack = g_list_remove (windows_stack, (gconstpointer) c2);
+ windows_stack = g_list_insert_before (windows_stack, sibling, c2);
+ }
+ }
+ else
+ {
+ /* There will be no window on top of the transient window, so place it at the end of list */
+ windows_stack = g_list_remove (windows_stack, (gconstpointer) c2);
+ windows_stack = g_list_append (windows_stack, c2);
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (transients)
+ {
+ g_list_free (transients);
+ }
+ if (windows_stack_copy)
+ {
+ g_list_free (windows_stack_copy);
+ }
+ /* Now, windows_stack contains the correct window stack
+ We still need to tell the X Server to reflect the changes
+ */
+ clientApplyStackList ();
+ clientSetNetClientList (net_client_list_stacking, windows_stack);
+ last_raise = c;
}
}
@@ -381,52 +381,52 @@ clientLower (Client * c)
if (g_list_length (windows_stack) < 1)
{
- return;
+ return;
}
if (FLAG_TEST (c->flags, CLIENT_FLAG_MANAGED))
{
- Client *client_sibling = NULL;
-
- if (clientIsTransientOrModalForGroup (c))
- {
- client_sibling = clientGetTopMostForGroup (c);
- }
- else if (clientIsTransient (c))
- {
- client_sibling = clientGetTransient (c);
- }
- if (!client_sibling)
- {
- client_sibling = clientGetBottomMost (c->win_layer, c);
- }
- if (client_sibling != c)
- {
- windows_stack = g_list_remove (windows_stack, (gconstpointer) c);
- /* Paranoid check to avoid circular linked list */
- if (client_sibling)
- {
- GList *sibling = g_list_find (windows_stack, (gconstpointer) client_sibling);
- gint position = g_list_position (windows_stack, sibling) + 1;
-
- windows_stack = g_list_insert (windows_stack, c, position);
- TRACE ("lowest client is \"%s\" (0x%lx) at position %i",
- client_sibling->name, client_sibling->window, position);
- }
- else
- {
- windows_stack = g_list_prepend (windows_stack, c);
- }
- }
- /* Now, windows_stack contains the correct window stack
- We still need to tell the X Server to reflect the changes
- */
- clientApplyStackList ();
- clientSetNetClientList (net_client_list_stacking, windows_stack);
- if (last_raise == c)
- {
- last_raise = NULL;
- }
+ Client *client_sibling = NULL;
+
+ if (clientIsTransientOrModalForGroup (c))
+ {
+ client_sibling = clientGetTopMostForGroup (c);
+ }
+ else if (clientIsTransient (c))
+ {
+ client_sibling = clientGetTransient (c);
+ }
+ if (!client_sibling)
+ {
+ client_sibling = clientGetBottomMost (c->win_layer, c);
+ }
+ if (client_sibling != c)
+ {
+ windows_stack = g_list_remove (windows_stack, (gconstpointer) c);
+ /* Paranoid check to avoid circular linked list */
+ if (client_sibling)
+ {
+ GList *sibling = g_list_find (windows_stack, (gconstpointer) client_sibling);
+ gint position = g_list_position (windows_stack, sibling) + 1;
+
+ windows_stack = g_list_insert (windows_stack, c, position);
+ TRACE ("lowest client is \"%s\" (0x%lx) at position %i",
+ client_sibling->name, client_sibling->window, position);
+ }
+ else
+ {
+ windows_stack = g_list_prepend (windows_stack, c);
+ }
+ }
+ /* Now, windows_stack contains the correct window stack
+ We still need to tell the X Server to reflect the changes
+ */
+ clientApplyStackList ();
+ clientSetNetClientList (net_client_list_stacking, windows_stack);
+ if (last_raise == c)
+ {
+ last_raise = NULL;
+ }
}
}
@@ -442,49 +442,49 @@ clientAddToList (Client * c)
client_count++;
if (clients)
{
- c->prev = clients->prev;
- c->next = clients;
- clients->prev->next = c;
- clients->prev = c;
+ c->prev = clients->prev;
+ c->next = clients;
+ clients->prev->next = c;
+ clients->prev = c;
}
else
{
- clients = c;
- c->next = c;
- c->prev = c;
+ clients = c;
+ c->next = c;
+ c->prev = c;
}
TRACE ("adding window \"%s\" (0x%lx) to windows list", c->name,
- c->window);
+ c->window);
windows = g_list_append (windows, c);
client_sibling = clientGetLowestTransient (c);
/* Paranoid check to avoid circular linked list */
if (client_sibling != c)
{
- if (client_sibling)
- {
- /* The client has already a transient mapped */
- sibling = g_list_find (windows_stack, (gconstpointer) client_sibling);
- windows_stack = g_list_insert_before (windows_stack, sibling, c);
- }
- else
- {
- client_sibling = clientGetNextTopMost (c->win_layer, c);
- /* Paranoid check to avoid circular linked list */
- if (client_sibling != c)
- {
- if (client_sibling)
- {
- sibling = g_list_find (windows_stack, (gconstpointer) client_sibling);
- windows_stack = g_list_insert_before (windows_stack, sibling, c);
- }
- else
- {
- windows_stack = g_list_append (windows_stack, c);
- }
- }
- }
+ if (client_sibling)
+ {
+ /* The client has already a transient mapped */
+ sibling = g_list_find (windows_stack, (gconstpointer) client_sibling);
+ windows_stack = g_list_insert_before (windows_stack, sibling, c);
+ }
+ else
+ {
+ client_sibling = clientGetNextTopMost (c->win_layer, c);
+ /* Paranoid check to avoid circular linked list */
+ if (client_sibling != c)
+ {
+ if (client_sibling)
+ {
+ sibling = g_list_find (windows_stack, (gconstpointer) client_sibling);
+ windows_stack = g_list_insert_before (windows_stack, sibling, c);
+ }
+ else
+ {
+ windows_stack = g_list_append (windows_stack, c);
+ }
+ }
+ }
}
clientSetNetClientList (net_client_list, windows);
@@ -505,24 +505,24 @@ clientRemoveFromList (Client * c)
client_count--;
if (client_count == 0)
{
- clients = NULL;
+ clients = NULL;
}
else
{
- c->next->prev = c->prev;
- c->prev->next = c->next;
- if (c == clients)
- {
- clients = clients->next;
- }
+ c->next->prev = c->prev;
+ c->prev->next = c->next;
+ if (c == clients)
+ {
+ clients = clients->next;
+ }
}
TRACE ("removing window \"%s\" (0x%lx) from windows list", c->name,
- c->window);
+ c->window);
windows = g_list_remove (windows, c);
TRACE ("removing window \"%s\" (0x%lx) from windows_stack list", c->name,
- c->window);
+ c->window);
windows_stack = g_list_remove (windows_stack, c);
clientSetNetClientList (net_client_list, windows);
@@ -538,7 +538,7 @@ clientGetStackList (void)
GList *windows_stack_copy = NULL;
if (windows_stack)
{
- windows_stack_copy = g_list_copy (windows_stack);
+ windows_stack_copy = g_list_copy (windows_stack);
}
return windows_stack_copy;
}
diff --git a/src/stacking.h b/src/stacking.h
index 7d9bf9192..b4da206c9 100644
--- a/src/stacking.h
+++ b/src/stacking.h
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
diff --git a/src/startup_notification.c b/src/startup_notification.c
index 55700be6a..a84f732f6 100644
--- a/src/startup_notification.c
+++ b/src/startup_notification.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- Metacity - (c) 2003 Havoc Pennington
- xfwm4 - (c) 2003 Olivier Fourdan
+ Metacity - (c) 2003 Havoc Pennington
+ xfwm4 - (c) 2003 Olivier Fourdan
*/
@@ -81,11 +81,11 @@ sn_update_feedback (void)
if (startup_sequences != NULL)
{
- XDefineCursor (dpy, root, busy_cursor);
+ XDefineCursor (md->dpy, md->xroot, md->busy_cursor);
}
else
{
- XDefineCursor (dpy, root, root_cursor);
+ XDefineCursor (md->dpy, md->xroot, md->root_cursor);
}
}
@@ -101,8 +101,8 @@ sn_add_sequence (SnStartupSequence * sequence)
if (startup_sequence_timeout == 0)
{
- startup_sequence_timeout =
- g_timeout_add (1000, sn_startup_sequence_timeout, NULL);
+ startup_sequence_timeout =
+ g_timeout_add (1000, sn_startup_sequence_timeout, NULL);
}
sn_update_feedback ();
}
@@ -119,8 +119,8 @@ sn_remove_sequence (SnStartupSequence * sequence)
if ((startup_sequences == NULL) && (startup_sequence_timeout != 0))
{
- g_source_remove (startup_sequence_timeout);
- startup_sequence_timeout = 0;
+ g_source_remove (startup_sequence_timeout);
+ startup_sequence_timeout = 0;
}
sn_update_feedback ();
}
@@ -139,12 +139,12 @@ sn_collect_timed_out_foreach (void *element, void *data)
sn_startup_sequence_get_last_active_time (sequence, &tv_sec, &tv_usec);
elapsed =
- ((((double) ctod->now.tv_sec - tv_sec) * G_USEC_PER_SEC +
- (ctod->now.tv_usec - tv_usec))) / 1000.0;
+ ((((double) ctod->now.tv_sec - tv_sec) * G_USEC_PER_SEC +
+ (ctod->now.tv_usec - tv_usec))) / 1000.0;
if (elapsed > STARTUP_TIMEOUT)
{
- ctod->list = g_slist_prepend (ctod->list, sequence);
+ ctod->list = g_slist_prepend (ctod->list, sequence);
}
}
@@ -164,24 +164,24 @@ sn_startup_sequence_timeout (void *data)
tmp = ctod.list;
while (tmp != NULL)
{
- SnStartupSequence *sequence = tmp->data;
+ SnStartupSequence *sequence = tmp->data;
- sn_startup_sequence_complete (sequence);
+ sn_startup_sequence_complete (sequence);
- tmp = tmp->next;
+ tmp = tmp->next;
}
g_slist_free (ctod.list);
if (startup_sequences != NULL)
{
- return TRUE;
+ return TRUE;
}
else
{
- /* remove */
- startup_sequence_timeout = 0;
- return FALSE;
+ /* remove */
+ startup_sequence_timeout = 0;
+ return FALSE;
}
}
@@ -199,22 +199,22 @@ sn_screen_event (SnMonitorEvent * event, void *user_data)
switch (sn_monitor_event_get_type (event))
{
- case SN_MONITOR_EVENT_INITIATED:
- wmclass = sn_startup_sequence_get_wmclass (sequence);
- sn_add_sequence (sequence);
- break;
-
- case SN_MONITOR_EVENT_COMPLETED:
- sn_remove_sequence (sn_monitor_event_get_startup_sequence
- (event));
- break;
-
- case SN_MONITOR_EVENT_CHANGED:
- break;
-
- case SN_MONITOR_EVENT_CANCELED:
- default:
- break;
+ case SN_MONITOR_EVENT_INITIATED:
+ wmclass = sn_startup_sequence_get_wmclass (sequence);
+ sn_add_sequence (sequence);
+ break;
+
+ case SN_MONITOR_EVENT_COMPLETED:
+ sn_remove_sequence (sn_monitor_event_get_startup_sequence
+ (event));
+ break;
+
+ case SN_MONITOR_EVENT_CHANGED:
+ break;
+
+ case SN_MONITOR_EVENT_CANCELED:
+ default:
+ break;
}
}
@@ -233,72 +233,72 @@ sn_client_startup_properties (Client * c)
sequence = NULL;
if (startup_id == NULL)
{
- tmp = startup_sequences;
- while (tmp != NULL)
- {
- const char *wmclass;
-
- wmclass = sn_startup_sequence_get_wmclass (tmp->data);
-
- if ((wmclass != NULL) && ((c->class.res_class
- && !strcmp (wmclass, c->class.res_class))
- || (c->class.res_name
- && !strcmp (wmclass, c->class.res_name))))
- {
- sequence = tmp->data;
-
- free (c->startup_id);
- c->startup_id =
- strdup (sn_startup_sequence_get_id (sequence));
- startup_id = c->startup_id;
-
- sn_startup_sequence_complete (sequence);
- break;
- }
-
- tmp = tmp->next;
- }
+ tmp = startup_sequences;
+ while (tmp != NULL)
+ {
+ const char *wmclass;
+
+ wmclass = sn_startup_sequence_get_wmclass (tmp->data);
+
+ if ((wmclass != NULL) && ((c->class.res_class
+ && !strcmp (wmclass, c->class.res_class))
+ || (c->class.res_name
+ && !strcmp (wmclass, c->class.res_name))))
+ {
+ sequence = tmp->data;
+
+ free (c->startup_id);
+ c->startup_id =
+ strdup (sn_startup_sequence_get_id (sequence));
+ startup_id = c->startup_id;
+
+ sn_startup_sequence_complete (sequence);
+ break;
+ }
+
+ tmp = tmp->next;
+ }
}
if (startup_id == NULL)
{
- return;
+ return;
}
if (sequence == NULL)
{
- tmp = startup_sequences;
- while (tmp != NULL)
- {
- const char *id;
+ tmp = startup_sequences;
+ while (tmp != NULL)
+ {
+ const char *id;
- id = sn_startup_sequence_get_id (tmp->data);
+ id = sn_startup_sequence_get_id (tmp->data);
- if (!strcmp (id, startup_id))
- {
- sequence = tmp->data;
- break;
- }
+ if (!strcmp (id, startup_id))
+ {
+ sequence = tmp->data;
+ break;
+ }
- tmp = tmp->next;
- }
+ tmp = tmp->next;
+ }
}
if (sequence != NULL)
{
- int workspace;
-
- if (!FLAG_TEST (c->flags, CLIENT_FLAG_WORKSPACE_SET))
- {
- workspace = sn_startup_sequence_get_workspace (sequence);
- if (workspace >= 0)
- {
- FLAG_SET (c->flags, CLIENT_FLAG_WORKSPACE_SET);
- c->win_workspace = workspace;
- }
- }
-
- return;
+ int workspace;
+
+ if (!FLAG_TEST (c->flags, CLIENT_FLAG_WORKSPACE_SET))
+ {
+ workspace = sn_startup_sequence_get_workspace (sequence);
+ if (workspace >= 0)
+ {
+ FLAG_SET (c->flags, CLIENT_FLAG_WORKSPACE_SET);
+ c->win_workspace = workspace;
+ }
+ }
+
+ return;
}
}
@@ -313,9 +313,9 @@ sn_init_display (Display * dpy, int screen)
sn_display = sn_display_new (dpy, sn_error_trap_push, sn_error_trap_pop);
if (sn_display != NULL)
{
- sn_context =
- sn_monitor_context_new (sn_display, screen, sn_screen_event, NULL,
- NULL);
+ sn_context =
+ sn_monitor_context_new (sn_display, screen, sn_screen_event, NULL,
+ NULL);
}
startup_sequences = NULL;
startup_sequence_timeout = 0;
@@ -326,7 +326,7 @@ sn_close_display (void)
{
if (sn_display)
{
- sn_display_unref (sn_display);
+ sn_display_unref (sn_display);
}
sn_display = NULL;
}
diff --git a/src/startup_notification.h b/src/startup_notification.h
index 720202b5f..b80d4bb92 100644
--- a/src/startup_notification.h
+++ b/src/startup_notification.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- Metacity - (c) 2003 Havoc Pennington
- xfwm4 - (c) 2003 Olivier Fourdan
+ Metacity - (c) 2003 Havoc Pennington
+ xfwm4 - (c) 2003 Olivier Fourdan
*/
diff --git a/src/tabwin.c b/src/tabwin.c
index ce1617234..82397620c 100644
--- a/src/tabwin.c
+++ b/src/tabwin.c
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2003 Olivier Fourdan
+ xfwm4 - (c) 2003 Olivier Fourdan
*/
@@ -43,14 +43,14 @@ tabwinCreate (gchar * label)
if (!icon)
{
- icon = xfce_inline_icon_at_size (tabwin_icon_data, 32, 32);
- g_object_ref (G_OBJECT (icon));
+ icon = xfce_inline_icon_at_size (tabwin_icon_data, 32, 32);
+ g_object_ref (G_OBJECT (icon));
}
tabwin->window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_container_set_border_width (GTK_CONTAINER (tabwin->window), 0);
gtk_window_set_position (GTK_WINDOW (tabwin->window),
- GTK_WIN_POS_CENTER_ALWAYS);
+ GTK_WIN_POS_CENTER_ALWAYS);
gtk_window_set_default_size (GTK_WINDOW (tabwin->window), 320, -1);
gtk_widget_set_size_request (tabwin->window, 320, -1);
gtk_window_set_resizable (GTK_WINDOW (tabwin->window), FALSE);
@@ -84,7 +84,7 @@ tabwinCreate (gchar * label)
tabwin->label = gtk_label_new ("");
if (label)
{
- tabwinSetLabel (tabwin, label);
+ tabwinSetLabel (tabwin, label);
}
gtk_misc_set_alignment (GTK_MISC (tabwin->label), 0.5, 0.5);
gtk_widget_show (tabwin->label);
@@ -101,11 +101,11 @@ tabwinSetLabel (Tabwin * tabwin, gchar * label)
if (label)
{
- gtk_label_set_text (GTK_LABEL (tabwin->label), label);
+ gtk_label_set_text (GTK_LABEL (tabwin->label), label);
}
else
{
- gtk_label_set_text (GTK_LABEL (tabwin->label), "");
+ gtk_label_set_text (GTK_LABEL (tabwin->label), "");
}
gtk_widget_queue_draw (tabwin->window);
}
diff --git a/src/tabwin.h b/src/tabwin.h
index d7eed30e8..cc840f980 100644
--- a/src/tabwin.h
+++ b/src/tabwin.h
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2003 Olivier Fourdan
+ xfwm4 - (c) 2003 Olivier Fourdan
*/
diff --git a/src/transients.c b/src/transients.c
index 99c757c36..f0b235c90 100644
--- a/src/transients.c
+++ b/src/transients.c
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
@@ -37,10 +37,10 @@ clientGetTransient (Client * c)
TRACE ("entering clientGetTransient");
- if ((c->transient_for) && (c->transient_for != root))
+ if ((c->transient_for) && (c->transient_for != md->xroot))
{
- c2 = clientGetFromWindow (c->transient_for, WINDOW);
- return c2;
+ c2 = clientGetFromWindow (c->transient_for, WINDOW);
+ return c2;
}
return NULL;
}
@@ -52,8 +52,8 @@ clientIsTransient (Client * c)
TRACE ("entering clientIsTransient");
- return (((c->transient_for != root) && (c->transient_for != None)) ||
- ((c->transient_for == root) && (c->group_leader != None)));
+ return (((c->transient_for != md->xroot) && (c->transient_for != None)) ||
+ ((c->transient_for == md->xroot) && (c->group_leader != None)));
}
gboolean
@@ -64,8 +64,8 @@ clientIsModal (Client * c)
TRACE ("entering clientIsModal");
return (FLAG_TEST (c->flags, CLIENT_FLAG_STATE_MODAL) &&
- (((c->transient_for != root) && (c->transient_for != None)) ||
- (c->group_leader != None)));
+ (((c->transient_for != md->xroot) && (c->transient_for != None)) ||
+ (c->group_leader != None)));
}
gboolean
@@ -87,10 +87,10 @@ clientSameGroup (Client * c1, Client * c2)
TRACE ("entering clientSameGroup");
return ((c1 != c2) &&
- (((c1->group_leader != None) &&
- (c1->group_leader == c2->group_leader)) ||
- (c1->group_leader == c2->window) ||
- (c2->group_leader == c1->window)));
+ (((c1->group_leader != None) &&
+ (c1->group_leader == c2->group_leader)) ||
+ (c1->group_leader == c2->window) ||
+ (c2->group_leader == c1->window)));
}
gboolean
@@ -103,14 +103,14 @@ clientIsTransientFor (Client * c1, Client * c2)
if ((c1->transient_for) && (c1->serial >= c2->serial))
{
- if (c1->transient_for != root)
- {
- return (c1->transient_for == c2->window);
- }
- else
- {
- return (clientSameGroup (c1, c2));
- }
+ if (c1->transient_for != md->xroot)
+ {
+ return (c1->transient_for == c2->window);
+ }
+ else
+ {
+ return (clientSameGroup (c1, c2));
+ }
}
return FALSE;
}
@@ -125,7 +125,7 @@ clientIsModalFor (Client * c1, Client * c2)
if (FLAG_TEST (c1->flags, CLIENT_FLAG_STATE_MODAL) && (c1->serial >= c2->serial))
{
- return (clientIsTransientFor (c1, c2) || clientSameGroup (c1, c2));
+ return (clientIsTransientFor (c1, c2) || clientSameGroup (c1, c2));
}
return FALSE;
}
@@ -148,7 +148,7 @@ clientIsTransientForGroup (Client * c)
TRACE ("entering clientIsTransientForGroup");
- return ((c->transient_for == root) && (c->group_leader != None));
+ return ((c->transient_for == md->xroot) && (c->group_leader != None));
}
gboolean
@@ -159,7 +159,7 @@ clientIsModalForGroup (Client * c)
TRACE ("entering clientIsModalForGroup");
return (FLAG_TEST (c->flags, CLIENT_FLAG_STATE_MODAL) &&
- !clientIsTransient(c) && (c->group_leader != None));
+ !clientIsTransient(c) && (c->group_leader != None));
}
gboolean
@@ -185,33 +185,33 @@ clientGetModalFor (Client * c)
for (index1 = windows_stack; index1; index1 = g_list_next (index1))
{
- c2 = (Client *) index1->data;
- if (c2)
- {
- if ((c2 != c) && clientIsModalFor (c2, c))
- {
- modals = g_list_append (modals, c2);
- latest_modal = c2;
- }
- else
- {
- for (index2 = modals; index2;
- index2 = g_list_next (index2))
- {
- c3 = (Client *) index2->data;
- if ((c3 != c2) && clientIsModalFor (c2, c3))
- {
- modals = g_list_append (modals, c2);
- latest_modal = c2;
- break;
- }
- }
- }
- }
+ c2 = (Client *) index1->data;
+ if (c2)
+ {
+ if ((c2 != c) && clientIsModalFor (c2, c))
+ {
+ modals = g_list_append (modals, c2);
+ latest_modal = c2;
+ }
+ else
+ {
+ for (index2 = modals; index2;
+ index2 = g_list_next (index2))
+ {
+ c3 = (Client *) index2->data;
+ if ((c3 != c2) && clientIsModalFor (c2, c3))
+ {
+ modals = g_list_append (modals, c2);
+ latest_modal = c2;
+ break;
+ }
+ }
+ }
+ }
}
if (modals)
{
- g_list_free (modals);
+ g_list_free (modals);
}
return latest_modal;
@@ -230,27 +230,27 @@ clientListTransient (Client * c)
transients = g_list_append (transients, c);
for (index1 = windows_stack; index1; index1 = g_list_next (index1))
{
- c2 = (Client *) index1->data;
- if (c2 != c)
- {
- if (clientIsTransientFor (c2, c))
- {
- transients = g_list_append (transients, c2);
- }
- else
- {
- for (index2 = transients; index2;
- index2 = g_list_next (index2))
- {
- c3 = (Client *) index2->data;
- if ((c3 != c2) && clientIsTransientFor (c2, c3))
- {
- transients = g_list_append (transients, c2);
- break;
- }
- }
- }
- }
+ c2 = (Client *) index1->data;
+ if (c2 != c)
+ {
+ if (clientIsTransientFor (c2, c))
+ {
+ transients = g_list_append (transients, c2);
+ }
+ else
+ {
+ for (index2 = transients; index2;
+ index2 = g_list_next (index2))
+ {
+ c3 = (Client *) index2->data;
+ if ((c3 != c2) && clientIsTransientFor (c2, c3))
+ {
+ transients = g_list_append (transients, c2);
+ break;
+ }
+ }
+ }
+ }
}
return transients;
}
@@ -268,27 +268,27 @@ clientListTransientOrModal (Client * c)
transients = g_list_append (transients, c);
for (index1 = windows_stack; index1; index1 = g_list_next (index1))
{
- c2 = (Client *) index1->data;
- if (c2 != c)
- {
- if (clientIsTransientOrModalFor (c2, c))
- {
- transients = g_list_append (transients, c2);
- }
- else
- {
- for (index2 = transients; index2;
- index2 = g_list_next (index2))
- {
- c3 = (Client *) index2->data;
- if ((c3 != c2) && clientIsTransientOrModalFor (c2, c3))
- {
- transients = g_list_append (transients, c2);
- break;
- }
- }
- }
- }
+ c2 = (Client *) index1->data;
+ if (c2 != c)
+ {
+ if (clientIsTransientOrModalFor (c2, c))
+ {
+ transients = g_list_append (transients, c2);
+ }
+ else
+ {
+ for (index2 = transients; index2;
+ index2 = g_list_next (index2))
+ {
+ c3 = (Client *) index2->data;
+ if ((c3 != c2) && clientIsTransientOrModalFor (c2, c3))
+ {
+ transients = g_list_append (transients, c2);
+ break;
+ }
+ }
+ }
+ }
}
return transients;
}
diff --git a/src/transients.h b/src/transients.h
index 3a5781cdd..938d649da 100644
--- a/src/transients.h
+++ b/src/transients.h
@@ -1,19 +1,19 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- xfwm4 - (c) 2002-2004 Olivier Fourdan
+ xfwm4 - (c) 2002-2004 Olivier Fourdan
*/
diff --git a/src/workspaces.c b/src/workspaces.c
index 04b9e89f9..d0a1a4429 100644
--- a/src/workspaces.c
+++ b/src/workspaces.c
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/
@@ -56,26 +56,26 @@ workspaceSwitch (int new_ws, Client * c2)
if (new_ws > params.workspace_count - 1)
{
- new_ws = 0;
+ new_ws = 0;
}
else if (new_ws < 0)
{
- new_ws = params.workspace_count - 1;
+ new_ws = params.workspace_count - 1;
}
- if (new_ws == workspace)
+ if (new_ws == md->current_ws)
{
- return;
+ return;
}
/* Grab the pointer to avoid side effects with EnterNotify events */
- XGrabPointer (dpy, gnome_win, FALSE, EnterWindowMask, GrabModeAsync,
- GrabModeAsync, None, None, GDK_CURRENT_TIME);
+ XGrabPointer (md->dpy, md->gnome_win, FALSE, EnterWindowMask, GrabModeAsync,
+ GrabModeAsync, None, None, GDK_CURRENT_TIME);
- workspace = new_ws;
+ md->current_ws = new_ws;
if (c2)
{
- clientSetWorkspace (c2, new_ws, FALSE);
+ clientSetWorkspace (c2, new_ws, FALSE);
}
list_hide = NULL;
@@ -84,85 +84,85 @@ workspaceSwitch (int new_ws, Client * c2)
/* First pass */
for (index = windows_stack; index; index = g_list_next (index))
{
- c = (Client *) index->data;
- if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_VISIBLE,
- CLIENT_FLAG_STICKY) && ((c->win_workspace != new_ws)))
- {
- if (c == previous)
- {
- FLAG_SET (previous->flags, CLIENT_FLAG_FOCUS);
- clientSetFocus (NULL, GDK_CURRENT_TIME, FOCUS_IGNORE_MODAL);
- }
- if (!clientIsTransientOrModal (c))
- {
- /* Just build of windows that will be hidden, so that
- we can record the previous focus even when on a
- transient (otherwise the transient vanishes along
- with its parent window which is placed below...
- */
- list_hide = g_list_append (list_hide, c);
- }
- }
+ c = (Client *) index->data;
+ if (FLAG_TEST_AND_NOT (c->flags, CLIENT_FLAG_VISIBLE,
+ CLIENT_FLAG_STICKY) && ((c->win_workspace != new_ws)))
+ {
+ if (c == previous)
+ {
+ FLAG_SET (previous->flags, CLIENT_FLAG_FOCUS);
+ clientSetFocus (NULL, GDK_CURRENT_TIME, FOCUS_IGNORE_MODAL);
+ }
+ if (!clientIsTransientOrModal (c))
+ {
+ /* Just build of windows that will be hidden, so that
+ we can record the previous focus even when on a
+ transient (otherwise the transient vanishes along
+ with its parent window which is placed below...
+ */
+ list_hide = g_list_append (list_hide, c);
+ }
+ }
}
/* First pass and a half :) */
if (list_hide)
{
- for (index = list_hide; index; index = g_list_next (index))
- {
- c = (Client *) index->data;
- clientHide (c, new_ws, FALSE);
- }
- g_list_free (list_hide);
+ for (index = list_hide; index; index = g_list_next (index))
+ {
+ c = (Client *) index->data;
+ clientHide (c, new_ws, FALSE);
+ }
+ g_list_free (list_hide);
}
/* Second pass */
for (index = g_list_last(windows_stack); index; index = g_list_previous (index))
{
- c = (Client *) index->data;
- if (FLAG_TEST (c->flags, CLIENT_FLAG_STICKY | CLIENT_FLAG_VISIBLE))
- {
- clientSetWorkspace (c, new_ws, TRUE);
- if (c == previous)
- {
- new_focus = c;
- }
- FLAG_UNSET (c->flags, CLIENT_FLAG_FOCUS);
- }
- else if ((c->win_workspace == new_ws)
- && !FLAG_TEST (c->flags, CLIENT_FLAG_HIDDEN))
- {
- if (!clientIsTransientOrModal (c))
- {
- clientShow (c, FALSE);
- }
- if ((!new_focus) && FLAG_TEST (c->flags, CLIENT_FLAG_FOCUS))
- {
- new_focus = c;
- }
- FLAG_UNSET (c->flags, CLIENT_FLAG_FOCUS);
- }
+ c = (Client *) index->data;
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_STICKY | CLIENT_FLAG_VISIBLE))
+ {
+ clientSetWorkspace (c, new_ws, TRUE);
+ if (c == previous)
+ {
+ new_focus = c;
+ }
+ FLAG_UNSET (c->flags, CLIENT_FLAG_FOCUS);
+ }
+ else if ((c->win_workspace == new_ws)
+ && !FLAG_TEST (c->flags, CLIENT_FLAG_HIDDEN))
+ {
+ if (!clientIsTransientOrModal (c))
+ {
+ clientShow (c, FALSE);
+ }
+ if ((!new_focus) && FLAG_TEST (c->flags, CLIENT_FLAG_FOCUS))
+ {
+ new_focus = c;
+ }
+ FLAG_UNSET (c->flags, CLIENT_FLAG_FOCUS);
+ }
}
- setHint (dpy, root, win_workspace, new_ws);
+ setHint (md->dpy, md->xroot, win_workspace, new_ws);
data[0] = new_ws;
- XChangeProperty (dpy, root, net_current_desktop, XA_CARDINAL, 32,
- PropModeReplace, (unsigned char *) data, 1);
- workspaceUpdateArea (margins, gnome_margins);
+ XChangeProperty (md->dpy, md->xroot, net_current_desktop, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *) data, 1);
+ workspaceUpdateArea (md->margins, md->gnome_margins);
/* Ungrab the pointer we grabbed before mapping/unmapping all windows */
- XUngrabPointer (dpy, GDK_CURRENT_TIME);
+ XUngrabPointer (md->dpy, GDK_CURRENT_TIME);
if (!(params.click_to_focus))
{
- if (!(c2) && (XQueryPointer (dpy, root, &dr, &window, &rx, &ry, &wx, &wy, &mask)))
- {
- c = clientAtPosition (rx, ry, NULL);
- if (c)
- {
- new_focus = c;
- }
- }
+ if (!(c2) && (XQueryPointer (md->dpy, md->xroot, &dr, &window, &rx, &ry, &wx, &wy, &mask)))
+ {
+ c = clientAtPosition (rx, ry, NULL);
+ if (c)
+ {
+ new_focus = c;
+ }
+ }
}
clientSetFocus (new_focus, GDK_CURRENT_TIME, NO_FOCUS_FLAG);
}
@@ -172,7 +172,7 @@ workspaceSetNames (char *names, int length)
{
if (params.workspace_names)
{
- g_free (params.workspace_names);
+ g_free (params.workspace_names);
}
params.workspace_names = names;
@@ -189,29 +189,32 @@ workspaceSetCount (int count)
if (count < 1)
{
- count = 1;
+ count = 1;
}
if (count == params.workspace_count)
{
- return;
+ return;
}
- setHint (dpy, root, win_workspace_count, count);
- setHint (dpy, root, net_number_of_desktops, count);
+ setHint (md->dpy, md->xroot, win_workspace_count, count);
+ setHint (md->dpy, md->xroot, net_number_of_desktops, count);
params.workspace_count = count;
for (c = clients, i = 0; i < client_count; c = c->next, i++)
{
- if (c->win_workspace > count - 1)
- {
- clientSetWorkspace (c, count - 1, TRUE);
- }
+ if (c->win_workspace > count - 1)
+ {
+ clientSetWorkspace (c, count - 1, TRUE);
+ }
}
- if (workspace > count - 1)
+ if (md->current_ws > count - 1)
{
- workspaceSwitch (count - 1, NULL);
+ workspaceSwitch (count - 1, NULL);
}
- setNetWorkarea (dpy, screen, params.workspace_count, margins);
+ setNetWorkarea (md->dpy, md->screen, params.workspace_count,
+ gdk_screen_get_width (md->gscr),
+ gdk_screen_get_height (md->gscr),
+ md->margins);
}
void
@@ -226,29 +229,29 @@ workspaceGetArea (int * m1, int * m2, Client * c)
for (i = 0; i < 4; i++)
{
- if (m2 == NULL)
- {
- m1[i] = 0;
- }
- else
- {
- m1[i] = m2[i];
- }
+ if (m2 == NULL)
+ {
+ m1[i] = 0;
+ }
+ else
+ {
+ m1[i] = m2[i];
+ }
}
for (c2 = clients, i = 0; i < client_count; c2 = c2->next, i++)
{
- if (((!c) || (c != c2))
- && FLAG_TEST_ALL (c2->flags,
- CLIENT_FLAG_HAS_STRUT | CLIENT_FLAG_VISIBLE))
- {
- m1[TOP] = MAX (m1[TOP], c2->struts[TOP]);
- m1[LEFT] = MAX (m1[LEFT], c2->struts[LEFT]);
- m1[RIGHT] =
- MAX (m1[RIGHT], c2->struts[RIGHT]);
- m1[BOTTOM] =
- MAX (m1[BOTTOM], c2->struts[BOTTOM]);
- }
+ if (((!c) || (c != c2))
+ && FLAG_TEST_ALL (c2->flags,
+ CLIENT_FLAG_HAS_STRUT | CLIENT_FLAG_VISIBLE))
+ {
+ m1[TOP] = MAX (m1[TOP], c2->struts[TOP]);
+ m1[LEFT] = MAX (m1[LEFT], c2->struts[LEFT]);
+ m1[RIGHT] =
+ MAX (m1[RIGHT], c2->struts[RIGHT]);
+ m1[BOTTOM] =
+ MAX (m1[BOTTOM], c2->struts[BOTTOM]);
+ }
}
}
@@ -273,12 +276,15 @@ workspaceUpdateArea (int * m1, int * m2)
workspaceGetArea (m1, m2, NULL);
TRACE ("Desktop area computed : (%d,%d,%d,%d)", (int) m1[0], (int) m1[1],
- (int) m1[2], (int) m1[3]);
+ (int) m1[2], (int) m1[3]);
if ((prev_top != m1[TOP]) || (prev_left != m1[LEFT])
- || (prev_right != m1[RIGHT])
- || (prev_bottom != m1[BOTTOM]))
+ || (prev_right != m1[RIGHT])
+ || (prev_bottom != m1[BOTTOM]))
{
- TRACE ("Margins have changed, updating net_workarea");
- setNetWorkarea (dpy, screen, params.workspace_count, m1);
+ TRACE ("Margins have changed, updating net_workarea");
+ setNetWorkarea (md->dpy, md->screen, params.workspace_count,
+ gdk_screen_get_width (md->gscr),
+ gdk_screen_get_height (md->gscr),
+ m1);
}
}
diff --git a/src/workspaces.h b/src/workspaces.h
index dce56ed89..c78159956 100644
--- a/src/workspaces.h
+++ b/src/workspaces.h
@@ -1,20 +1,20 @@
/*
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; You may only use version 2 of the License,
- you have no option to use any other version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; You may only use version 2 of the License,
+ you have no option to use any other version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- oroborus - (c) 2001 Ken Lynch
- xfwm4 - (c) 2002-2003 Olivier Fourdan
+ oroborus - (c) 2001 Ken Lynch
+ xfwm4 - (c) 2002-2003 Olivier Fourdan
*/