diff options
author | Olivier Fourdan <fourdan.olivier@wanadoo.fr> | 2002-05-24 08:03:27 +0000 |
---|---|---|
committer | Olivier Fourdan <fourdan.olivier@wanadoo.fr> | 2002-05-24 08:03:27 +0000 |
commit | 44d426814875f5038bf9b947cf85a5e373ca2044 (patch) | |
tree | 5e07b9a7c0f1f5f72a76123c20573257c32ca2c5 | |
parent | a8704e5f0674a8e5d6a9be5f548fa80d8953e621 (diff) | |
download | xfwm4-44d426814875f5038bf9b947cf85a5e373ca2044.tar.gz |
As suggested by JAsper, adjust .indent.pro options for my own taste and apply on sources.
(Old svn revision: 10336)
45 files changed, 2355 insertions, 3090 deletions
diff --git a/Makefile.am b/Makefile.am index fbccee1c7..4fa954adf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ @SET_MAKE@ -EXTRA_DIST = example.xfwm4rc example.xfwm4rc.in xfwm4.spec xfwm4.spec.in +EXTRA_DIST = example.xfwm4rc example.xfwm4rc.in example.gtkrc-2.0 xfwm4.spec xfwm4.spec.in SUBDIRS = src defaults themes diff --git a/Makefile.in b/Makefile.in index e3772da67..a7fb7761b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -63,7 +63,7 @@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ -EXTRA_DIST = example.xfwm4rc example.xfwm4rc.in xfwm4.spec xfwm4.spec.in +EXTRA_DIST = example.xfwm4rc example.xfwm4rc.in example.gtkrc-2.0 xfwm4.spec xfwm4.spec.in SUBDIRS = src defaults themes ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 diff --git a/src/.indent.pro b/src/.indent.pro index 46a0aca85..4c5863c86 100644 --- a/src/.indent.pro +++ b/src/.indent.pro @@ -1,13 +1,13 @@ -i4 -bli0 -cli4 --l80 +-l512 -nut -npsl -nbbo -ncs -npcs -nprs --nsaf +-nsafq -nsai -nsaw diff --git a/src/Makefile.in b/src/Makefile.in index 229a8cebf..21d5f9977 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -67,36 +67,7 @@ CFLAGS = @CFLAGS@ @X_CFLAGS@ @BASE_DEPENDENCIES_CFLAGS@ -DDATADIR=\"$(pkgdatadir LIBS = @LIBS@ @X_LIBS@ @BASE_DEPENDENCIES_LIBS@ bin_PROGRAMS = xfwm4 -xfwm4_SOURCES = \ - client.c \ - events.c \ - frame.c \ - gtk_style.c \ - gtktoxevent.c \ - hints.c \ - keyboard.c \ - main.c \ - menu.c \ - misc.c \ - parserc.c \ - pixmap.c \ - settings.c \ - workspaces.c \ - client.h \ - debug.h \ - events.h \ - frame.h \ - gtk_style.h \ - gtktoxevent.h \ - hints.h \ - keyboard.h \ - main.h \ - menu.h \ - misc.h \ - parserc.h \ - pixmap.h \ - settings.h \ - workspaces.h +xfwm4_SOURCES = client.c events.c frame.c gtk_style.c gtktoxevent.c hints.c keyboard.c main.c menu.c misc.c parserc.c pixmap.c settings.c workspaces.c client.h debug.h events.h frame.h gtk_style.h gtktoxevent.h hints.h keyboard.h main.h menu.h misc.h parserc.h pixmap.h settings.h workspaces.h mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h diff --git a/src/client.c b/src/client.c index c13f84972..d025ecc24 100644 --- a/src/client.c +++ b/src/client.c @@ -36,27 +36,27 @@ #include "debug.h" /* You don't like that ? Me either, but, hell, it's the way glib lists are designed */ -#define XWINDOW_TO_GPOINTER(w) ((gpointer) (Window) (w)) +#define XWINDOW_TO_GPOINTER(w) ((gpointer) (Window) (w)) #define GPOINTER_TO_XWINDOW(p) ((Window) (p)) -Client *clients = NULL; -unsigned int client_count = 0; +Client *clients = NULL; +unsigned int client_count = 0; -static Window *client_list = NULL; -static GSList *windows = NULL; +static Window *client_list = NULL; +static GSList *windows = NULL; static GSList *windows_stack = NULL; -static Client *client_focus = NULL; +static Client *client_focus = NULL; /* Forward decl */ -static unsigned long clientGetNetWmDesktop (Client *c); -static void clientWindowType (Client *c); +static unsigned long clientGetNetWmDesktop(Client * c); +static void clientWindowType(Client * c); typedef struct _MoveResizeData MoveResizeData; struct _MoveResizeData { gboolean use_keys; gboolean grab; - int mx, my; + int mx, my; int ox, oy; int oldw, oldh; int corner; @@ -70,373 +70,373 @@ struct _ButtonPressData Client *c; }; -void clientSetNetState (Client *c) +void clientSetNetState(Client * c) { int i; Atom data[12]; unsigned long desk; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientSetNetState\n"); DBG("client \"%s\" (%#lx)\n", c->name, c->window); i = 0; - if (c->shaded) + if(c->shaded) { DBG("clientSetNetState : shaded\n"); - data[i++] = net_wm_state_shaded; + data[i++] = net_wm_state_shaded; } - if (c->sticky) + if(c->sticky) { DBG("clientSetNetState : sticky\n"); - data[i++] = net_wm_state_sticky; + data[i++] = net_wm_state_sticky; } - if (c->state_modal) + if(c->state_modal) { DBG("clientSetNetState : modal\n"); - data[i++] = net_wm_state_modal; + data[i++] = net_wm_state_modal; } - if (c->skip_pager) + if(c->skip_pager) { DBG("clientSetNetState : skip_pager\n"); - data[i++] = net_wm_state_skip_pager; + data[i++] = net_wm_state_skip_pager; } - if (c->skip_taskbar) + if(c->skip_taskbar) { DBG("clientSetNetState : skip_taskbar\n"); - data[i++] = net_wm_state_skip_taskbar; + data[i++] = net_wm_state_skip_taskbar; } - if (c->win_state & WIN_STATE_MAXIMIZED) + if(c->win_state & WIN_STATE_MAXIMIZED) { DBG("clientSetNetState : maximize vert + horiz\n"); - data[i++] = net_wm_state_maximized_horz; - data[i++] = net_wm_state_maximized_vert; + data[i++] = net_wm_state_maximized_horz; + data[i++] = net_wm_state_maximized_vert; } - else if (c->win_state & WIN_STATE_MAXIMIZED_HORIZ) + else if(c->win_state & WIN_STATE_MAXIMIZED_HORIZ) { DBG("clientSetNetState : maximize horiz\n"); - data[i++] = net_wm_state_maximized_horz; + data[i++] = net_wm_state_maximized_horz; } - else if (c->win_state & WIN_STATE_MAXIMIZED_VERT) + else if(c->win_state & WIN_STATE_MAXIMIZED_VERT) { DBG("clientSetNetState : vert\n"); - data[i++] = net_wm_state_maximized_vert; + data[i++] = net_wm_state_maximized_vert; } - if (c->fullscreen) + if(c->fullscreen) { DBG("clientSetNetState : fullscreen\n"); - data[i++] = net_wm_state_fullscreen; + data[i++] = net_wm_state_fullscreen; } - if ((c->shaded) || (c->hidden)) + if((c->shaded) || (c->hidden)) { DBG("clientSetNetState : hidden\n"); - data[i++] = net_wm_state_hidden; + data[i++] = net_wm_state_hidden; } - XChangeProperty (dpy, c->window, net_wm_state, XA_ATOM, 32, PropModeReplace, (unsigned char *) data, i); - desk = clientGetNetWmDesktop (c); - setNetHint (dpy, c->window, net_wm_desktop, desk); + XChangeProperty(dpy, c->window, net_wm_state, XA_ATOM, 32, PropModeReplace, (unsigned char *)data, i); + desk = clientGetNetWmDesktop(c); + setNetHint(dpy, c->window, net_wm_desktop, desk); } -static void clientGetNetState (Client *c) +static void clientGetNetState(Client * c) { int n_atoms = 0; Atom *atoms = NULL; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientGetNetState\n"); DBG("client \"%s\" (%#lx)\n", c->name, c->window); c->state_modal = False; c->skip_pager = False; c->skip_taskbar = False; - - if (get_atom_list (dpy, c->window, net_wm_state, &atoms, &n_atoms)) + + if(get_atom_list(dpy, c->window, net_wm_state, &atoms, &n_atoms)) { - int i; + int i; - i = 0; - while (i < n_atoms) - { - if (atoms[i] == net_wm_state_shaded) - { + i = 0; + while(i < n_atoms) + { + if(atoms[i] == net_wm_state_shaded) + { DBG("clientGetNetState : shaded\n"); - c->win_state |= WIN_STATE_SHADED; - c->shaded = True; + c->win_state |= WIN_STATE_SHADED; + c->shaded = True; } - if (atoms[i] == net_wm_state_sticky) - { + if(atoms[i] == net_wm_state_sticky) + { DBG("clientGetNetState : sticky\n"); - c->win_state |= WIN_STATE_STICKY; - c->sticky = True; + c->win_state |= WIN_STATE_STICKY; + c->sticky = True; } - else if (atoms[i] == net_wm_state_maximized_horz) - { + else if(atoms[i] == net_wm_state_maximized_horz) + { DBG("clientGetNetState : maximized horiz\n"); c->win_state |= WIN_STATE_MAXIMIZED_HORIZ; - c->maximized = True; + c->maximized = True; } - else if (atoms[i] == net_wm_state_maximized_vert) - { + else if(atoms[i] == net_wm_state_maximized_vert) + { DBG("clientGetNetState : maximized vert\n"); c->win_state |= WIN_STATE_MAXIMIZED_VERT; - c->maximized = True; + c->maximized = True; } - else if (atoms[i] == net_wm_state_fullscreen) - { + else if(atoms[i] == net_wm_state_fullscreen) + { DBG("clientGetNetState : fullscreen\n"); - c->fullscreen = True; + c->fullscreen = True; } - else if (atoms[i] == net_wm_state_modal) - { + else if(atoms[i] == net_wm_state_modal) + { DBG("clientGetNetState : modal\n"); c->state_modal = True; } ++i; - } - if (atoms) - { - XFree (atoms); - } + } + if(atoms) + { + XFree(atoms); + } } - if (c->win_state & (WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ)) + if(c->win_state & (WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ)) { c->win_state |= WIN_STATE_MAXIMIZED; c->win_state &= ~(WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ); } } -void clientUpdateNetState (Client *c, XClientMessageEvent * ev) +void clientUpdateNetState(Client * c, XClientMessageEvent * ev) { unsigned long action; Atom first; Atom second; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientUpdateNetState\n"); DBG("client \"%s\" (%#lx)\n", c->name, c->window); action = ((XEvent *) ev)->xclient.data.l[0]; - first = ((XEvent *) ev)->xclient.data.l[1]; + first = ((XEvent *) ev)->xclient.data.l[1]; second = ((XEvent *) ev)->xclient.data.l[2]; - if ((first == net_wm_state_shaded) || (second == net_wm_state_shaded)) + if((first == net_wm_state_shaded) || (second == net_wm_state_shaded)) { if(((action == NET_WM_STATE_ADD) && !(c->shaded)) || ((action == NET_WM_STATE_REMOVE) && (c->shaded)) || (action == NET_WM_STATE_TOGGLE)) - { - clientToggleShaded (c); - } + { + clientToggleShaded(c); + } } - if ((first == net_wm_state_sticky) || (second == net_wm_state_sticky)) + if((first == net_wm_state_sticky) || (second == net_wm_state_sticky)) { if(((action == NET_WM_STATE_ADD) && !(c->sticky)) || ((action == NET_WM_STATE_REMOVE) && (c->sticky)) || (action == NET_WM_STATE_TOGGLE)) - { - clientToggleSticky (c); - } + { + clientToggleSticky(c); + } } - if ((first == net_wm_state_maximized_horz) || (second == net_wm_state_maximized_horz) || (first == net_wm_state_maximized_vert) || (second == net_wm_state_maximized_vert)) + if((first == net_wm_state_maximized_horz) || (second == net_wm_state_maximized_horz) || (first == net_wm_state_maximized_vert) || (second == net_wm_state_maximized_vert)) { if((action == NET_WM_STATE_ADD) && !(c->maximized)) - { - unsigned long mode = 0; - if ((first == net_wm_state_maximized_horz) || (second == net_wm_state_maximized_horz)) - { - mode |= WIN_STATE_MAXIMIZED_HORIZ; - } - if ((first == net_wm_state_maximized_vert) || (second == net_wm_state_maximized_vert)) - { - mode |= WIN_STATE_MAXIMIZED_VERT; - } - if (mode & (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT)) - { - mode |= WIN_STATE_MAXIMIZED; + { + unsigned long mode = 0; + if((first == net_wm_state_maximized_horz) || (second == net_wm_state_maximized_horz)) + { + mode |= WIN_STATE_MAXIMIZED_HORIZ; + } + if((first == net_wm_state_maximized_vert) || (second == net_wm_state_maximized_vert)) + { + mode |= WIN_STATE_MAXIMIZED_VERT; + } + if(mode & (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT)) + { + mode |= WIN_STATE_MAXIMIZED; mode &= ~(WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ); - } - clientToggleMaximized(c, mode); - } + } + clientToggleMaximized(c, mode); + } else if((action == NET_WM_STATE_REMOVE) && (c->maximized)) - { - unsigned long mode = 0; - if (mode & WIN_STATE_MAXIMIZED) - { + { + unsigned long mode = 0; + if(mode & WIN_STATE_MAXIMIZED) + { mode |= (WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ); - } + } mode &= ~WIN_STATE_MAXIMIZED; - if ((first == net_wm_state_maximized_horz) || (second == net_wm_state_maximized_horz)) - { - mode &= ~WIN_STATE_MAXIMIZED_HORIZ; - } - if ((first == net_wm_state_maximized_vert) || (second == net_wm_state_maximized_vert)) - { - mode &= ~WIN_STATE_MAXIMIZED_VERT; - } - clientToggleMaximized(c, mode); - } - else if (action == NET_WM_STATE_TOGGLE) - { - unsigned long mode = 0; - if (mode & WIN_STATE_MAXIMIZED) - { + if((first == net_wm_state_maximized_horz) || (second == net_wm_state_maximized_horz)) + { + mode &= ~WIN_STATE_MAXIMIZED_HORIZ; + } + if((first == net_wm_state_maximized_vert) || (second == net_wm_state_maximized_vert)) + { + mode &= ~WIN_STATE_MAXIMIZED_VERT; + } + clientToggleMaximized(c, mode); + } + else if(action == NET_WM_STATE_TOGGLE) + { + unsigned long mode = 0; + if(mode & WIN_STATE_MAXIMIZED) + { mode &= ~WIN_STATE_MAXIMIZED; mode |= (WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ); - } - if ((first == net_wm_state_maximized_horz) || (second == net_wm_state_maximized_horz)) - { - mode ^= WIN_STATE_MAXIMIZED_HORIZ; - } - if ((first == net_wm_state_maximized_vert) || (second == net_wm_state_maximized_vert)) - { - mode ^= WIN_STATE_MAXIMIZED_VERT; - } - if (mode & (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT)) - { - mode |= WIN_STATE_MAXIMIZED; + } + if((first == net_wm_state_maximized_horz) || (second == net_wm_state_maximized_horz)) + { + mode ^= WIN_STATE_MAXIMIZED_HORIZ; + } + if((first == net_wm_state_maximized_vert) || (second == net_wm_state_maximized_vert)) + { + mode ^= WIN_STATE_MAXIMIZED_VERT; + } + if(mode & (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT)) + { + mode |= WIN_STATE_MAXIMIZED; mode &= ~(WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ); - } - clientToggleMaximized(c, mode); - } - } - - if ((first == net_wm_state_modal) || (second == net_wm_state_modal)) - { - if ((action == NET_WM_STATE_ADD) && !(c->state_modal)) - { - c->state_modal = True; - clientSetNetState (c); - } - else if ((action == NET_WM_STATE_REMOVE) && (c->state_modal)) - { - c->state_modal = False; - clientSetNetState (c); - } - else if (action == NET_WM_STATE_TOGGLE) - { - c->state_modal = ((c->state_modal) ? False : True); - clientSetNetState (c); - } - } - - if ((first == net_wm_state_fullscreen) || (second == net_wm_state_fullscreen)) - { - if ((action == NET_WM_STATE_ADD) && !(c->fullscreen)) - { - c->fullscreen = True; - } - else if ((action == NET_WM_STATE_REMOVE) && (c->fullscreen)) - { - c->fullscreen = False; - } - else if (action == NET_WM_STATE_TOGGLE) - { - c->fullscreen = ((c->fullscreen) ? False : True); - } + } + clientToggleMaximized(c, mode); + } + } + + if((first == net_wm_state_modal) || (second == net_wm_state_modal)) + { + if((action == NET_WM_STATE_ADD) && !(c->state_modal)) + { + c->state_modal = True; + clientSetNetState(c); + } + else if((action == NET_WM_STATE_REMOVE) && (c->state_modal)) + { + c->state_modal = False; + clientSetNetState(c); + } + else if(action == NET_WM_STATE_TOGGLE) + { + c->state_modal = ((c->state_modal) ? False : True); + clientSetNetState(c); + } + } + + if((first == net_wm_state_fullscreen) || (second == net_wm_state_fullscreen)) + { + if((action == NET_WM_STATE_ADD) && !(c->fullscreen)) + { + c->fullscreen = True; + } + else if((action == NET_WM_STATE_REMOVE) && (c->fullscreen)) + { + c->fullscreen = False; + } + else if(action == NET_WM_STATE_TOGGLE) + { + c->fullscreen = ((c->fullscreen) ? False : True); + } clientToggleFullscreen(c); } - if ((first == net_wm_state_skip_pager) || (second == net_wm_state_skip_pager)) + if((first == net_wm_state_skip_pager) || (second == net_wm_state_skip_pager)) { - if ((action == NET_WM_STATE_ADD) && !(c->skip_pager)) + if((action == NET_WM_STATE_ADD) && !(c->skip_pager)) + { + c->skip_pager = True; + clientSetNetState(c); + } + else if((action == NET_WM_STATE_REMOVE) && (c->skip_pager)) { - c->skip_pager = True; - clientSetNetState (c); - } - else if ((action == NET_WM_STATE_REMOVE) && (c->skip_pager)) - { - c->skip_pager = False; - clientSetNetState (c); - } - else if (action == NET_WM_STATE_TOGGLE) - { - c->skip_pager = ((c->skip_pager) ? False : True); - clientSetNetState (c); - } + c->skip_pager = False; + clientSetNetState(c); + } + else if(action == NET_WM_STATE_TOGGLE) + { + c->skip_pager = ((c->skip_pager) ? False : True); + clientSetNetState(c); + } } - if ((first == net_wm_state_skip_taskbar) || (second == net_wm_state_skip_taskbar)) + if((first == net_wm_state_skip_taskbar) || (second == net_wm_state_skip_taskbar)) { - if ((action == NET_WM_STATE_ADD) && !(c->skip_taskbar)) + if((action == NET_WM_STATE_ADD) && !(c->skip_taskbar)) + { + c->skip_taskbar = True; + clientSetNetState(c); + } + else if((action == NET_WM_STATE_REMOVE) && (c->skip_taskbar)) { - c->skip_taskbar = True; - clientSetNetState (c); - } - else if ((action == NET_WM_STATE_REMOVE) && (c->skip_taskbar)) - { - c->skip_taskbar = False; - clientSetNetState (c); - } - else if (action == NET_WM_STATE_TOGGLE) - { - c->skip_taskbar = ((c->skip_taskbar) ? False : True); - clientSetNetState (c); - } + c->skip_taskbar = False; + clientSetNetState(c); + } + else if(action == NET_WM_STATE_TOGGLE) + { + c->skip_taskbar = ((c->skip_taskbar) ? False : True); + clientSetNetState(c); + } } } -void clientGetNetWmType (Client *c) +void clientGetNetWmType(Client * c) { int n_atoms = 0; Atom *atoms = NULL; int i; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientGetNetWmType\n"); DBG("client \"%s\" (%#lx)\n", c->name, c->window); n_atoms = 0; atoms = NULL; - if (!get_atom_list (dpy, c->window, net_wm_window_type, &atoms, &n_atoms)) + if(!get_atom_list(dpy, c->window, net_wm_window_type, &atoms, &n_atoms)) { - switch (c->win_layer) - { + switch (c->win_layer) + { case WIN_LAYER_DESKTOP: - c->type_atom = net_wm_window_type_desktop; - break; + c->type_atom = net_wm_window_type_desktop; + break; case WIN_LAYER_DOCK: - c->type_atom = net_wm_window_type_dock; - break; + c->type_atom = net_wm_window_type_dock; + break; case WIN_LAYER_NORMAL: default: - c->type_atom = net_wm_window_type_normal; - break; - } + c->type_atom = net_wm_window_type_normal; + break; + } } else { - i = 0; - while (i < n_atoms) - { - if ((atoms[i] == net_wm_window_type_desktop) || (atoms[i] == net_wm_window_type_dock) || (atoms[i] == net_wm_window_type_toolbar) || (atoms[i] == net_wm_window_type_menu) || (atoms[i] == net_wm_window_type_dialog) || (atoms[i] == net_wm_window_type_normal) || (atoms[i] == net_wm_window_type_utility) || (atoms[i] == net_wm_window_type_splashscreen)) - { - c->type_atom = atoms[i]; - break; - } - ++i; - } - if (atoms) - { - XFree (atoms); - } - } - clientWindowType (c); + i = 0; + while(i < n_atoms) + { + if((atoms[i] == net_wm_window_type_desktop) || (atoms[i] == net_wm_window_type_dock) || (atoms[i] == net_wm_window_type_toolbar) || (atoms[i] == net_wm_window_type_menu) || (atoms[i] == net_wm_window_type_dialog) || (atoms[i] == net_wm_window_type_normal) || (atoms[i] == net_wm_window_type_utility) || (atoms[i] == net_wm_window_type_splashscreen)) + { + c->type_atom = atoms[i]; + break; + } + ++i; + } + if(atoms) + { + XFree(atoms); + } + } + clientWindowType(c); } -static unsigned long clientGetNetWmDesktop (Client *c) +static unsigned long clientGetNetWmDesktop(Client * c) { - g_return_val_if_fail (c != NULL, workspace); + g_return_val_if_fail(c != NULL, workspace); DBG("entering clientGetNetWmDesktop\n"); DBG("client \"%s\" (%#lx)\n", c->name, c->window); - - return ((unsigned long) c->win_workspace); + + return ((unsigned long)c->win_workspace); } -static void clientGetInitialNetWmDesktop (Client *c) +static void clientGetInitialNetWmDesktop(Client * c) { long val = 0; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientGetInitialNetWmDesktop\n"); DBG("client \"%s\" (%#lx)\n", c->name, c->window); @@ -444,22 +444,22 @@ static void clientGetInitialNetWmDesktop (Client *c) if(getNetHint(dpy, c->window, net_wm_desktop, &val)) { DBG("atom net_wm_desktop detected\n"); - if (val == (int) 0xFFFFFFFF) - { + if(val == (int)0xFFFFFFFF) + { DBG("atom net_wm_desktop specifies window \"%s\" is sticky\n", c->name); - c->win_workspace = workspace; - clientStick (c); - } - else - { - DBG("atom net_wm_desktop specifies window \"%s\" is on desk %i\n", c->name, (int) val); - c->win_workspace = (int) val; - } + c->win_workspace = workspace; + clientStick(c); + } + else + { + DBG("atom net_wm_desktop specifies window \"%s\" is on desk %i\n", c->name, (int)val); + c->win_workspace = (int)val; + } } - else if (getGnomeHint(dpy, c->window, win_workspace, &val)) + else if(getGnomeHint(dpy, c->window, win_workspace, &val)) { - DBG("atom win_workspace specifies window \"%s\" is on desk %i\n", c->name, (int) val); - c->win_workspace = (int) val; + DBG("atom win_workspace specifies window \"%s\" is on desk %i\n", c->name, (int)val); + c->win_workspace = (int)val; } DBG("initial desktop for window \"%s\" is %i\n", c->name, c->win_workspace); if(c->win_workspace > workspace_count - 1) @@ -472,219 +472,219 @@ static void clientGetInitialNetWmDesktop (Client *c) setNetHint(dpy, c->window, net_wm_desktop, c->win_workspace); } -static void clientSetNetClientList (Atom a, GSList *list) +static void clientSetNetClientList(Atom a, GSList * list) { Window *listw; Window *index_dest; GSList *index_src; guint size, i; - + DBG("entering clientSetNetClientList\n"); - + size = g_slist_length(list); - if (size <= 0) + if(size <= 0) { - XDeleteProperty (dpy, root, a); + XDeleteProperty(dpy, root, a); } - else if ((listw = (Window *) malloc ((size + 1) * sizeof (Window)))) + else if((listw = (Window *) malloc((size + 1) * sizeof(Window)))) { - DBG("%i windows in list for %i clients\n", size, client_count); - for (i = 0, index_dest = listw, index_src = list; i < size; i++, index_dest++, index_src = g_slist_next (index_src)) - { - *index_dest = GPOINTER_TO_XWINDOW(index_src->data); - } - XChangeProperty (dpy, root, a, XA_WINDOW, 32, PropModeReplace, (unsigned char *) listw, size); - free (listw); + DBG("%i windows in list for %i clients\n", size, client_count); + for(i = 0, index_dest = listw, index_src = list; i < size; i++, index_dest++, index_src = g_slist_next(index_src)) + { + *index_dest = GPOINTER_TO_XWINDOW(index_src->data); + } + XChangeProperty(dpy, root, a, XA_WINDOW, 32, PropModeReplace, (unsigned char *)listw, size); + free(listw); } } -void clientGetNetStruts(Client *c) +void clientGetNetStruts(Client * c) { gulong *struts = NULL; int nitems; int i; - g_return_if_fail (c != NULL); - DBG("entering clientGetNetStruts for \"%s\" (%#lx)\n",c->name, c->window); + g_return_if_fail(c != NULL); + DBG("entering clientGetNetStruts for \"%s\" (%#lx)\n", c->name, c->window); for(i = 0; i < 4; i++) { c->struts[i] = 0; } c->has_struts = False; - - if (get_cardinal_list (dpy, c->window, net_wm_strut, &struts, &nitems)) + + if(get_cardinal_list(dpy, c->window, net_wm_strut, &struts, &nitems)) { - if (nitems != 4) + if(nitems != 4) { - XFree (struts); - return; + XFree(struts); + return; } - c->has_struts = True; - for(i = 0; i < 4; i++) - { + c->has_struts = True; + for(i = 0; i < 4; i++) + { c->struts[i] = struts[i]; - } + } - DBG("NET_WM_STRUT for window \"%s\"= (%d,%d,%d,%d)\n", c->name, c->struts[0], c->struts[1], c->struts[2], c->struts[3]); - XFree (struts); + DBG("NET_WM_STRUT for window \"%s\"= (%d,%d,%d,%d)\n", c->name, c->struts[0], c->struts[1], c->struts[2], c->struts[3]); + XFree(struts); workspaceUpdateArea(margins, gnome_margins); } } -static void clientWindowType (Client *c) +static void clientWindowType(Client * c) { WindowType old_type; int layer; - - g_return_if_fail (c != NULL); + + g_return_if_fail(c != NULL); DBG("entering clientWindowType\n"); DBG("type for client \"%s\" (%#lx)\n", c->name, c->window); - + old_type = c->type; layer = c->win_layer; - if (c->type_atom != None) + if(c->type_atom != None) { - if (c->type_atom == net_wm_window_type_desktop) - { + if(c->type_atom == net_wm_window_type_desktop) + { DBG("atom net_wm_window_type_desktop detected\n"); c->type = WINDOW_DESKTOP; - c->win_state |= WIN_STATE_STICKY; - c->has_border = False; - c->sticky = True; - c->skip_pager = True; - c->skip_taskbar = True; - layer = WIN_LAYER_DESKTOP; - } - else if (c->type_atom == net_wm_window_type_dock) - { + c->win_state |= WIN_STATE_STICKY; + c->has_border = False; + c->sticky = True; + c->skip_pager = True; + c->skip_taskbar = True; + layer = WIN_LAYER_DESKTOP; + } + else if(c->type_atom == net_wm_window_type_dock) + { DBG("atom net_wm_window_type_dock detected\n"); c->type = WINDOW_DOCK; - layer = WIN_LAYER_DOCK; - } - else if (c->type_atom == net_wm_window_type_toolbar) - { + layer = WIN_LAYER_DOCK; + } + else if(c->type_atom == net_wm_window_type_toolbar) + { DBG("atom net_wm_window_type_toolbar detected\n"); c->type = WINDOW_TOOLBAR; - layer = WIN_LAYER_NORMAL; - } - else if (c->type_atom == net_wm_window_type_menu) - { + layer = WIN_LAYER_NORMAL; + } + else if(c->type_atom == net_wm_window_type_menu) + { DBG("atom net_wm_window_type_menu detected\n"); c->type = WINDOW_MENU; - layer = WIN_LAYER_NORMAL; - /* The policy here is unclear : - http://mail.gnome.org/archives/wm-spec-list/2002-May/msg00001.html - As it seems, GNOME and KDE don't treat menu the same way... - c->win_state |= WIN_STATE_STICKY; - c->has_border = False; - c->sticky = True; - */ - c->skip_pager = True; - c->skip_taskbar = True; - } - else if (c->type_atom == net_wm_window_type_dialog) - { + layer = WIN_LAYER_NORMAL; + /* The policy here is unclear : + http://mail.gnome.org/archives/wm-spec-list/2002-May/msg00001.html + As it seems, GNOME and KDE don't treat menu the same way... + c->win_state |= WIN_STATE_STICKY; + c->has_border = False; + c->sticky = True; + */ + c->skip_pager = True; + c->skip_taskbar = True; + } + else if(c->type_atom == net_wm_window_type_dialog) + { DBG("atom net_wm_window_type_dialog detected\n"); c->type = WINDOW_DIALOG; - layer = WIN_LAYER_ONTOP; - } - else if (c->type_atom == net_wm_window_type_normal) - { + layer = WIN_LAYER_ONTOP; + } + else if(c->type_atom == net_wm_window_type_normal) + { DBG("atom net_wm_window_type_normal detected\n"); c->type = WINDOW_NORMAL; - layer = c->win_layer; - } - else if (c->type_atom == net_wm_window_type_utility) - { + layer = c->win_layer; + } + else if(c->type_atom == net_wm_window_type_utility) + { DBG("atom net_wm_window_type_utility detected\n"); c->type = WINDOW_UTILITY; - c->has_border = False; - layer = WIN_LAYER_NORMAL; - } - else if (c->type_atom == net_wm_window_type_splashscreen) - { + c->has_border = False; + layer = WIN_LAYER_NORMAL; + } + else if(c->type_atom == net_wm_window_type_splashscreen) + { DBG("atom net_wm_window_type_splashscreen detected\n"); c->type = WINDOW_SPLASHSCREEN; - c->has_border = False; - layer = WIN_LAYER_ABOVE_DOCK; - } + c->has_border = False; + layer = WIN_LAYER_ABOVE_DOCK; + } } else { - c->type = UNSET; - layer = c->win_layer; + c->type = UNSET; + layer = c->win_layer; } - if (c->transient_for != None) + if(c->transient_for != None) { - Client *c2; + Client *c2; DBG("no \"net\" atom detected\n"); - c->type = WINDOW_DIALOG; - c2 = clientGetFromWindow(c->transient_for, WINDOW); - if (c2) - { + c->type = WINDOW_DIALOG; + c2 = clientGetFromWindow(c->transient_for, WINDOW); + if(c2) + { layer = c2->win_layer; - } + } } - if ((old_type != c->type) || (layer != c->win_layer)) + if((old_type != c->type) || (layer != c->win_layer)) { DBG("setting layer %i\n", layer); - clientSetNetState (c); - clientSetLayer(c, layer); + clientSetNetState(c); + clientSetLayer(c, layer); } } -void clientInstallColormaps (Client *c) +void clientInstallColormaps(Client * c) { XWindowAttributes attr; gboolean installed = False; int i; - - g_return_if_fail (c != NULL); + + g_return_if_fail(c != NULL); DBG("entering clientInstallColormaps\n"); - if (c->ncmap) + if(c->ncmap) { - for (i = c->ncmap - 1; i >= 0; i--) - { - XGetWindowAttributes (dpy, c->cmap_windows[i], &attr); - XInstallColormap (dpy, attr.colormap); - if (c->cmap_windows[i] == c->window) - { - installed = True; - } - } + for(i = c->ncmap - 1; i >= 0; i--) + { + XGetWindowAttributes(dpy, c->cmap_windows[i], &attr); + XInstallColormap(dpy, attr.colormap); + if(c->cmap_windows[i] == c->window) + { + installed = True; + } + } } - if ((!installed) && (c->cmap)) + if((!installed) && (c->cmap)) { - XInstallColormap (dpy, c->cmap); + XInstallColormap(dpy, c->cmap); } } -void clientUpdateColormaps (Client *c) +void clientUpdateColormaps(Client * c) { XWindowAttributes attr; - - g_return_if_fail (c != NULL); + + g_return_if_fail(c != NULL); DBG("entering clientUpdateColormaps\n"); - if (c->ncmap) + if(c->ncmap) { - XFree (c->cmap_windows); + XFree(c->cmap_windows); } - if (!XGetWMColormapWindows (dpy, c->window, &c->cmap_windows, &c->ncmap)) + if(!XGetWMColormapWindows(dpy, c->window, &c->cmap_windows, &c->ncmap)) { - c->ncmap = 0; + c->ncmap = 0; } c->cmap = attr.colormap; } void clientGrabKeys(Client * c) { - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientGrabKeys\n"); DBG("grabbing keys for client \"%s\" (%#lx)\n", c->name, c->window); @@ -734,7 +734,7 @@ void clientGrabKeys(Client * c) void clientUngrabKeys(Client * c) { - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientUngrabKeys\n"); DBG("ungrabing keys for client \"%s\" (%#lx)\n", c->name, c->window); @@ -745,7 +745,7 @@ void clientGravitate(Client * c, int mode) { int gravity, dx = 0, dy = 0; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientGravitate\n"); gravity = c->size->flags & PWinGravity ? c->size->win_gravity : NorthWestGravity; @@ -797,22 +797,22 @@ static void clientAddToList(Client * c) int i; Window *new; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientAddToList\n"); client_count++; new = malloc(sizeof(Window) * client_count); if(new) { for(i = 0; i < client_count - 1; i++) - { + { new[i] = client_list[i]; } - new[i] = c->window; + new[i] = c->window; if(client_list) - { + { free(client_list); } - client_list = new; + client_list = new; XChangeProperty(dpy, root, win_client_list, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)client_list, client_count); } if(clients) @@ -828,18 +828,18 @@ static void clientAddToList(Client * c) c->next = c; c->prev = c; } - if (!(c->skip_taskbar)) + if(!(c->skip_taskbar)) { DBG("adding window \"%s\" (%#lx) to windows list\n", c->name, c->window); - windows = g_slist_append (windows, XWINDOW_TO_GPOINTER(c->window)); + windows = g_slist_append(windows, XWINDOW_TO_GPOINTER(c->window)); clientSetNetClientList(net_client_list, windows); } - if (!(c->skip_pager)) + if(!(c->skip_pager)) { DBG("adding window \"%s\" (%#lx) to windows_stack list\n", c->name, c->window); - windows_stack = g_slist_append (windows_stack, XWINDOW_TO_GPOINTER(c->window)); - clientSetNetClientList(net_client_list_stacking, windows_stack); + windows_stack = g_slist_append(windows_stack, XWINDOW_TO_GPOINTER(c->window)); + clientSetNetClientList(net_client_list_stacking, windows_stack); } c->managed = True; } @@ -849,26 +849,26 @@ static void clientRemoveFromList(Client * c) int i, j; Window *new; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientRemoveFromList\n"); - g_assert (client_count > 0); + g_assert(client_count > 0); c->managed = False; new = malloc(sizeof(Window) * client_count); if(new) { for(i = 0, j = 0; i < client_count; i++) - { + { if(client_list[i] != c->window) - { + { new[j++] = client_list[i]; - } - } + } + } if(client_list) - { + { free(client_list); } - client_list = new; + client_list = new; XChangeProperty(dpy, root, win_client_list, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)client_list, client_count - 1); } client_count--; @@ -881,28 +881,28 @@ static void clientRemoveFromList(Client * c) c->next->prev = c->prev; c->prev->next = c->next; if(c == clients) - { + { clients = clients->next; } } - if (!(c->skip_taskbar)) + if(!(c->skip_taskbar)) { DBG("removing window \"%s\" (%#lx) from windows list\n", c->name, c->window); - windows = g_slist_remove (windows, XWINDOW_TO_GPOINTER(c->window)); + windows = g_slist_remove(windows, XWINDOW_TO_GPOINTER(c->window)); clientSetNetClientList(net_client_list, windows); } - if (!(c->skip_pager)) + if(!(c->skip_pager)) { DBG("removing window \"%s\" (%#lx) from windows_stack list\n", c->name, c->window); - windows_stack = g_slist_remove (windows_stack, XWINDOW_TO_GPOINTER(c->window)); + windows_stack = g_slist_remove(windows_stack, XWINDOW_TO_GPOINTER(c->window)); clientSetNetClientList(net_client_list_stacking, windows_stack); } } static int clientGetWidthInc(Client * c) { - g_return_val_if_fail (c != NULL, 0); + g_return_val_if_fail(c != NULL, 0); if(c->size->flags & PResizeInc) { return c->size->width_inc; @@ -912,7 +912,7 @@ static int clientGetWidthInc(Client * c) static int clientGetHeightInc(Client * c) { - g_return_val_if_fail (c != NULL, 0); + g_return_val_if_fail(c != NULL, 0); if(c->size->flags & PResizeInc) { return c->size->height_inc; @@ -924,7 +924,7 @@ static void clientSetWidth(Client * c, int w1) { int w2; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientSetWidth\n"); DBG("setting width %i for client \"%s\" (%#lx)\n", w1, c->name, c->window); @@ -936,16 +936,16 @@ static void clientSetWidth(Client * c, int w1) if(c->size->flags & PMaxSize) { if(w1 > c->size->max_width) - { + { w1 = c->size->max_width; - } + } } if(c->size->flags & PMinSize) { if(w1 < c->size->min_width) - { + { w1 = c->size->min_width; - } + } } if(w1 < 1) { @@ -958,7 +958,7 @@ static void clientSetHeight(Client * c, int h1) { int h2; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientSetHeight\n"); DBG("setting height %i for client \"%s\" (%#lx)\n", h1, c->name, c->window); @@ -970,16 +970,16 @@ static void clientSetHeight(Client * c, int h1) if(c->size->flags & PMaxSize) { if(h1 > c->size->max_height) - { + { h1 = c->size->max_height; - } + } } if(c->size->flags & PMinSize) { if(h1 < c->size->min_height) - { + { h1 = c->size->min_height; - } + } } if(h1 < 1) { @@ -1001,17 +1001,17 @@ static inline Client *clientGetTopMost(int layer, Client * exclude) for(i = 0; i < count; i++) { c = clientGetFromWindow(wins[i], FRAME); - if (c) - { - DBG("*** stack window [%i]=(%lx) \"%s\", layer %i\n", i, c->window, c->name, c->win_layer); + if(c) + { + DBG("*** stack window [%i]=(%lx) \"%s\", layer %i\n", i, c->window, c->name, c->win_layer); if((c->visible) && (!exclude || (c != exclude))) { - if(c->win_layer <= layer) - { + if(c->win_layer <= layer) + { top = c; - } - } - } + } + } + } } if(wins) { @@ -1020,7 +1020,7 @@ static inline Client *clientGetTopMost(int layer, Client * exclude) return top; } -static inline Client *clientGetBottomMost(int layer, Client *exclude) +static inline Client *clientGetBottomMost(int layer, Client * exclude) { Window w1, w2, *wins = NULL; unsigned int i, count; @@ -1033,17 +1033,17 @@ static inline Client *clientGetBottomMost(int layer, Client *exclude) for(i = 0; i < count; i++) { c = clientGetFromWindow(wins[i], FRAME); - if (c) - { - DBG("*** stack window [%i]=(%lx) \"%s\", layer %i\n", i, c->window, c->name, c->win_layer); + if(c) + { + DBG("*** stack window [%i]=(%lx) \"%s\", layer %i\n", i, c->window, c->name, c->win_layer); if((c->visible) && (!exclude || (c != exclude))) { - if (c->win_layer >= layer) - { + if(c->win_layer >= layer) + { break; - } - } - } + } + } + } } if(wins) { @@ -1052,51 +1052,51 @@ static inline Client *clientGetBottomMost(int layer, Client *exclude) return c; } -static inline void clientComputeStackList(Client *c, Client *sibling, XWindowChanges * wc, int mask) +static inline void clientComputeStackList(Client * c, Client * sibling, XWindowChanges * wc, int mask) { - if ((c->managed) && !(c->skip_pager) && (mask & CWStackMode)) - { - if ((sibling) && (sibling != c) && (g_slist_find (windows_stack, XWINDOW_TO_GPOINTER(sibling->window)))) - { - gint position; - - if (wc->stack_mode == Below) - { - if (g_slist_index (windows_stack, XWINDOW_TO_GPOINTER(sibling->window)) > -1) - { - DBG("Below with sibling -> inserting window \"%s\" (%#lx) at position %i in stack list\n", c->name, c->window, position); - windows_stack = g_slist_remove (windows_stack, XWINDOW_TO_GPOINTER(c->window)); - position = g_slist_index (windows_stack, XWINDOW_TO_GPOINTER(sibling->window)); - windows_stack = g_slist_insert (windows_stack, XWINDOW_TO_GPOINTER(c->window), position); - } - } - else - { - if (g_slist_index (windows_stack, XWINDOW_TO_GPOINTER(sibling->window)) > -1) - { - windows_stack = g_slist_remove (windows_stack, XWINDOW_TO_GPOINTER(c->window)); - position = g_slist_index (windows_stack, XWINDOW_TO_GPOINTER(sibling->window)); - DBG("Above with sibling -> inserting window \"%s\" (%#lx) at position %i in stack list\n", c->name, c->window, position + 1); - windows_stack = g_slist_insert (windows_stack, XWINDOW_TO_GPOINTER(c->window), position + 1); - } - } - } - else - { - if (wc->stack_mode == Below) - { - DBG("Below without sibling -> inserting window \"%s\" (%#lx) at beginning of stack list\n", c->name, c->window); - windows_stack = g_slist_remove (windows_stack, XWINDOW_TO_GPOINTER(c->window)); - windows_stack = g_slist_prepend (windows_stack, XWINDOW_TO_GPOINTER(c->window)); - } - else - { - DBG("Above without sibling -> inserting window \"%s\" (%#lx) at end of stack list\n", c->name, c->window); - windows_stack = g_slist_remove (windows_stack, XWINDOW_TO_GPOINTER(c->window)); - windows_stack = g_slist_append (windows_stack, XWINDOW_TO_GPOINTER(c->window)); - } - } - } + if((c->managed) && !(c->skip_pager) && (mask & CWStackMode)) + { + if((sibling) && (sibling != c) && (g_slist_find(windows_stack, XWINDOW_TO_GPOINTER(sibling->window)))) + { + gint position; + + if(wc->stack_mode == Below) + { + if(g_slist_index(windows_stack, XWINDOW_TO_GPOINTER(sibling->window)) > -1) + { + DBG("Below with sibling -> inserting window \"%s\" (%#lx) at position %i in stack list\n", c->name, c->window, position); + windows_stack = g_slist_remove(windows_stack, XWINDOW_TO_GPOINTER(c->window)); + position = g_slist_index(windows_stack, XWINDOW_TO_GPOINTER(sibling->window)); + windows_stack = g_slist_insert(windows_stack, XWINDOW_TO_GPOINTER(c->window), position); + } + } + else + { + if(g_slist_index(windows_stack, XWINDOW_TO_GPOINTER(sibling->window)) > -1) + { + windows_stack = g_slist_remove(windows_stack, XWINDOW_TO_GPOINTER(c->window)); + position = g_slist_index(windows_stack, XWINDOW_TO_GPOINTER(sibling->window)); + DBG("Above with sibling -> inserting window \"%s\" (%#lx) at position %i in stack list\n", c->name, c->window, position + 1); + windows_stack = g_slist_insert(windows_stack, XWINDOW_TO_GPOINTER(c->window), position + 1); + } + } + } + else + { + if(wc->stack_mode == Below) + { + DBG("Below without sibling -> inserting window \"%s\" (%#lx) at beginning of stack list\n", c->name, c->window); + windows_stack = g_slist_remove(windows_stack, XWINDOW_TO_GPOINTER(c->window)); + windows_stack = g_slist_prepend(windows_stack, XWINDOW_TO_GPOINTER(c->window)); + } + else + { + DBG("Above without sibling -> inserting window \"%s\" (%#lx) at end of stack list\n", c->name, c->window); + windows_stack = g_slist_remove(windows_stack, XWINDOW_TO_GPOINTER(c->window)); + windows_stack = g_slist_append(windows_stack, XWINDOW_TO_GPOINTER(c->window)); + } + } + } } static void _clientConfigure(Client * c, XWindowChanges * wc, int mask) @@ -1109,8 +1109,8 @@ static void _clientConfigure(Client * c, XWindowChanges * wc, int mask) Client *prev_transient = NULL; int i; - g_return_if_fail (c != NULL); - g_return_if_fail (c->window != None); + g_return_if_fail(c != NULL); + g_return_if_fail(c->window != None); DBG("entering _clientConfigure (recursive)\n"); DBG("configuring (recursive) client \"%s\" (%#lx), layer %i\n", c->name, c->window, c->win_layer); @@ -1139,74 +1139,74 @@ static void _clientConfigure(Client * c, XWindowChanges * wc, int mask) switch (wc->stack_mode) { case Above: - DBG("Above\n"); - if (mask & CWSibling) - { - DBG("Sibling specified for \"%s\" (%#lx) is (%#lx)\n", c->name, c->window, wc->sibling); - sibling = clientGetFromWindow (wc->sibling, WINDOW); - } - else - { - DBG("No sibling specified for \"%s\" (%#lx)\n", c->name, c->window); + DBG("Above\n"); + if(mask & CWSibling) + { + DBG("Sibling specified for \"%s\" (%#lx) is (%#lx)\n", c->name, c->window, wc->sibling); + sibling = clientGetFromWindow(wc->sibling, WINDOW); + } + else + { + DBG("No sibling specified for \"%s\" (%#lx)\n", c->name, c->window); sibling = clientGetTopMost(c->win_layer, c); - } - if(!sibling) - { + } + if(!sibling) + { DBG("unable to determine sibling!\n"); wc->stack_mode = Below; - } - DBG("looking for transients\n"); - for(c2 = clients, i = 0; i < client_count; c2 = c2->next, i++) - { - DBG("checking \"%s\" (%#lx)\n", c2->name, c2->window); - if ((c2->transient_for == c->window) && (c2->window != c->window)) - { + } + DBG("looking for transients\n"); + for(c2 = clients, i = 0; i < client_count; c2 = c2->next, i++) + { + DBG("checking \"%s\" (%#lx)\n", c2->name, c2->window); + if((c2->transient_for == c->window) && (c2->window != c->window)) + { XWindowChanges wc2; DBG("transient \"%s\" (%#lx) found for \"%s\" (%#lx)\n", c2->name, c2->window, c->name, c->window); - if (!transients) - { - transients = TRUE; - lowest_transient = c2; - wc2.stack_mode = Above; + if(!transients) + { + transients = TRUE; + lowest_transient = c2; + wc2.stack_mode = Above; DBG("recursive call 1\n"); - _clientConfigure(c2, &wc2, CWStackMode); - } - else - { - lowest_transient = c2; - wc2.stack_mode = Below; - wc2.sibling = prev_transient->window; + _clientConfigure(c2, &wc2, CWStackMode); + } + else + { + lowest_transient = c2; + wc2.stack_mode = Below; + wc2.sibling = prev_transient->window; DBG("recursive call 2\n"); - _clientConfigure(c2, &wc2, CWStackMode | CWSibling); - } - prev_transient = c2; - } - if (transients && lowest_transient) - { - DBG("Transient is %s (%#lx)\n", sibling->name, sibling->window); - sibling = lowest_transient; - wc->stack_mode = Below; - } - } + _clientConfigure(c2, &wc2, CWStackMode | CWSibling); + } + prev_transient = c2; + } + if(transients && lowest_transient) + { + DBG("Transient is %s (%#lx)\n", sibling->name, sibling->window); + sibling = lowest_transient; + wc->stack_mode = Below; + } + } break; case Below: - DBG("Below\n"); - if (c->transient_for) - { - wc->sibling = c->transient_for; - wc->stack_mode = Above; - mask |= (CWSibling | CWStackMode); - sibling = clientGetFromWindow (wc->sibling, WINDOW); + DBG("Below\n"); + if(c->transient_for) + { + wc->sibling = c->transient_for; + wc->stack_mode = Above; + mask |= (CWSibling | CWStackMode); + sibling = clientGetFromWindow(wc->sibling, WINDOW); DBG("lowering transient \"%s\" (%#lx) for \"%s\" (%#lx)\n", c->name, c->window, c->transient_for, sibling->name); - } - else if (mask & CWSibling) - { - sibling = clientGetFromWindow (wc->sibling, WINDOW); - } - else - { + } + else if(mask & CWSibling) + { + sibling = clientGetFromWindow(wc->sibling, WINDOW); + } + else + { sibling = clientGetBottomMost(c->win_layer, c); - } + } break; } if(sibling) @@ -1217,15 +1217,15 @@ static void _clientConfigure(Client * c, XWindowChanges * wc, int mask) mask |= CWSibling; } else - { + { mask &= ~(CWSibling | CWStackMode); } - } + } else - { + { mask &= ~CWSibling; } - clientComputeStackList(c, sibling, wc, mask); + clientComputeStackList(c, sibling, wc, mask); } wc->x = frameX(c); @@ -1266,35 +1266,35 @@ void clientConfigure(Client * c, XWindowChanges * wc, int mask) DBG("entering clientConfigure\n"); DBG("configuring client \"%s\" (%#lx)\n", c->name, c->window); _clientConfigure(c, wc, mask); - if ((c->managed) && (mask & CWStackMode)) + if((c->managed) && (mask & CWStackMode)) { clientSetNetClientList(net_client_list_stacking, windows_stack); } } /* Compute rectangle overlap area */ -static unsigned long overlap (int x0, int y0, int x1, int y1, int tx0, int ty0, int tx1, int ty1) +static unsigned long overlap(int x0, int y0, int x1, int y1, int tx0, int ty0, int tx1, int ty1) { /* Compute overlapping box */ - if (tx0 > x0) + if(tx0 > x0) { - x0 = tx0; + x0 = tx0; } - if (ty0 > y0) + if(ty0 > y0) { - y0 = ty0; + y0 = ty0; } - if (tx1 < x1) + if(tx1 < x1) { - x1 = tx1; + x1 = tx1; } - if (ty1 < y1) + if(ty1 < y1) { - y1 = ty1; + y1 = ty1; } - if (x1 <= x0 || y1 <= y0) + if(x1 <= x0 || y1 <= y0) { - return 0; + return 0; } return (x1 - x0) * (y1 - y0); } @@ -1307,56 +1307,56 @@ static void clientInitPosition(Client * c) unsigned long best_overlaps = 0; gboolean first = TRUE; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientInitPosition\n"); - + clientGravitate(c, APPLY); if(c->size->flags & (PPosition | USPosition)) { return; } - - bw = frameWidth (c); - bh = frameHeight (c); - xmax = XDisplayWidth(dpy, screen) - bw - margins[MARGIN_RIGHT]; - ymax = XDisplayHeight(dpy, screen) - bh - margins[MARGIN_BOTTOM]; + + bw = frameWidth(c); + bh = frameHeight(c); + xmax = XDisplayWidth(dpy, screen) - bw - margins[MARGIN_RIGHT]; + ymax = XDisplayHeight(dpy, screen) - bh - margins[MARGIN_BOTTOM]; best_x = frameLeft(c) + margins[MARGIN_LEFT]; best_y = frameTop(c) + margins[MARGIN_TOP]; - for (test_y = frameTop(c) + margins[MARGIN_TOP]; test_y < ymax; test_y += 8) + for(test_y = frameTop(c) + margins[MARGIN_TOP]; test_y < ymax; test_y += 8) { - for (test_x = frameLeft(c) + margins[MARGIN_LEFT]; test_x < xmax; test_x += 8) - { - unsigned long count_overlaps = 0; + for(test_x = frameLeft(c) + margins[MARGIN_LEFT]; test_x < xmax; test_x += 8) + { + unsigned long count_overlaps = 0; DBG("analyzing %i clients\n", client_count); - for(c2 = clients, i = 0; i < client_count; c2 = c2->next, i++) - { - if ((c2 != c) && (c->win_layer == c2->win_layer) && (c->win_workspace == c2->win_workspace) && (c2->visible)) - { - count_overlaps += overlap (test_x, test_y, test_x + bw, test_y + bh, frameX(c2), frameY(c2), frameX(c2) + frameWidth(c2), frameY(c2) + frameHeight(c2)); - } - } + for(c2 = clients, i = 0; i < client_count; c2 = c2->next, i++) + { + if((c2 != c) && (c->win_layer == c2->win_layer) && (c->win_workspace == c2->win_workspace) && (c2->visible)) + { + count_overlaps += overlap(test_x, test_y, test_x + bw, test_y + bh, frameX(c2), frameY(c2), frameX(c2) + frameWidth(c2), frameY(c2) + frameHeight(c2)); + } + } DBG("overlaps so far is %u\n", count_overlaps); - if (count_overlaps == 0) - { + if(count_overlaps == 0) + { DBG("overlaps is 0 so it's the best we can get\n"); - c->x = test_x; - c->y = test_y; - return; - } - else if ((count_overlaps < best_overlaps) || (first)) - { + c->x = test_x; + c->y = test_y; + return; + } + else if((count_overlaps < best_overlaps) || (first)) + { DBG("overlaps %u is better than the best we have %u\n", count_overlaps, best_overlaps); - best_x = test_x; - best_y = test_y; - best_overlaps = count_overlaps; - } - if (first) - { - first = FALSE; - } - } + best_x = test_x; + best_y = test_y; + best_overlaps = count_overlaps; + } + if(first) + { + first = FALSE; + } + } } c->x = best_x; c->y = best_y; @@ -1377,15 +1377,15 @@ void clientFrame(Window w) int dummy_x, dummy_y; unsigned int dummy_width, dummy_height, dummy_depth, dummy_bw; - g_return_if_fail (w != None); + g_return_if_fail(w != None); DBG("entering clientFrame\n"); DBG("framing client (%#lx)\n", w); - if (w == gnome_win) + if(w == gnome_win) { return; } - + c = malloc(sizeof(Client)); if(!c) { @@ -1411,54 +1411,54 @@ void clientFrame(Window w) c->button_pressed[i] = False; } - if (!XGetWMColormapWindows (dpy, w, &c->cmap_windows, &c->ncmap)) + if(!XGetWMColormapWindows(dpy, w, &c->cmap_windows, &c->ncmap)) { - c->ncmap = 0; + c->ncmap = 0; } - c->type_atom = None; - c->type = UNSET; + c->type_atom = None; + c->type = UNSET; c->ignore_unmap = ((attr.map_state == IsViewable) ? 1 : 0); - c->managed = False; - c->focus = False; - c->has_border = True; - c->sticky = False; - c->maximized = False; - c->fullscreen = False; - c->shaded = False; - c->visible = False; - c->hidden = False; - c->state_modal = False; + c->managed = False; + c->focus = False; + c->has_border = True; + c->sticky = False; + c->maximized = False; + c->fullscreen = False; + c->shaded = False; + c->visible = False; + c->hidden = False; + c->state_modal = False; c->skip_taskbar = False; - c->skip_pager = False; - c->has_struts = False; - c->wm_takefocus = (getWMTakeFocus (dpy, c->window) ? True : False); - c->wm_input = (getWMInput (dpy, c->window) ? True : False); + c->skip_pager = False; + c->has_struts = False; + c->wm_takefocus = (getWMTakeFocus(dpy, c->window) ? True : False); + c->wm_input = (getWMInput(dpy, c->window) ? True : False); mwm_hints = getMotifHints(dpy, c->window); if(mwm_hints) { if(mwm_hints->flags & MWM_HINTS_DECORATIONS && !(mwm_hints->decorations & MWM_DECOR_ALL)) - { + { c->has_border = ((mwm_hints->decorations & MWM_DECOR_BORDER) ? True : False); } - XFree(mwm_hints); + XFree(mwm_hints); } getGnomeHint(dpy, w, win_hints, &c->win_hints); getGnomeHint(dpy, w, win_state, &c->win_state); - if (!getGnomeHint(dpy, w, win_layer, &c->win_layer)) + if(!getGnomeHint(dpy, w, win_layer, &c->win_layer)) { c->win_layer = WIN_LAYER_NORMAL; } - c->sticky = ((c->win_state & WIN_STATE_STICKY) ? True : False); - c->shaded = ((c->win_state & WIN_STATE_SHADED) ? True : False); - c->maximized = ((c->win_state & (WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED)) ? True : False); + c->sticky = ((c->win_state & WIN_STATE_STICKY) ? True : False); + c->shaded = ((c->win_state & WIN_STATE_SHADED) ? True : False); + c->maximized = ((c->win_state & (WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED)) ? True : False); /* Beware, order of calls is important here ! */ - clientGetNetState (c); - clientGetInitialNetWmDesktop (c); - clientGetNetWmType (c); + clientGetNetState(c); + clientGetInitialNetWmDesktop(c); + clientGetNetWmType(c); clientGetNetStruts(c); /* Once we know the type of window, we can initialize window position */ @@ -1471,29 +1471,29 @@ void clientFrame(Window w) clientGravitate(c, APPLY); } - MyXGrabServer (dpy); - if (XGetGeometry (dpy, w, &dummy_root, &dummy_x, &dummy_y, &dummy_width, &dummy_height, &dummy_bw, &dummy_depth) == 0) + MyXGrabServer(dpy); + if(XGetGeometry(dpy, w, &dummy_root, &dummy_x, &dummy_y, &dummy_width, &dummy_height, &dummy_bw, &dummy_depth) == 0) { - if(c->name) - { + if(c->name) + { free(c->name); - } - if(c->size) - { + } + if(c->size) + { XFree(c->size); - } - free (c); - MyXUngrabServer (dpy); - return; + } + free(c); + MyXUngrabServer(dpy); + return; } valuemask = CWEventMask; attributes.event_mask = (SubstructureNotifyMask | SubstructureRedirectMask | EnterWindowMask); - c->frame = XCreateWindow (dpy, root, frameX(c), frameY(c), frameWidth(c), frameHeight(c), 0, CopyFromParent, InputOutput, CopyFromParent, valuemask, &attributes); + c->frame = XCreateWindow(dpy, root, frameX(c), frameY(c), frameWidth(c), frameHeight(c), 0, CopyFromParent, InputOutput, CopyFromParent, valuemask, &attributes); DBG("frame id (%#lx)\n", c->frame); valuemask = (CWEventMask | CWDontPropagate); attributes.event_mask = (FocusChangeMask | PropertyChangeMask); attributes.do_not_propagate_mask = (ButtonPressMask | ButtonReleaseMask); - XChangeWindowAttributes (dpy, c->window, valuemask, &attributes); + XChangeWindowAttributes(dpy, c->window, valuemask, &attributes); if(shape) { XShapeSelectInput(dpy, c->window, ShapeNotifyMask); @@ -1501,17 +1501,17 @@ void clientFrame(Window w) XSetWindowBorderWidth(dpy, c->window, 0); XReparentWindow(dpy, c->window, c->frame, frameLeft(c), frameTop(c)); - MyXUngrabServer (dpy); + MyXUngrabServer(dpy); XGrabButton(dpy, AnyButton, AnyModifier, c->frame, False, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); - c->sides[SIDE_LEFT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); - c->sides[SIDE_RIGHT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); - c->sides[SIDE_BOTTOM] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); - c->corners[CORNER_BOTTOM_LEFT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); + c->sides[SIDE_LEFT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); + c->sides[SIDE_RIGHT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); + c->sides[SIDE_BOTTOM] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); + c->corners[CORNER_BOTTOM_LEFT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); c->corners[CORNER_BOTTOM_RIGHT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); - c->corners[CORNER_TOP_LEFT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); - c->corners[CORNER_TOP_RIGHT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); + c->corners[CORNER_TOP_LEFT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); + c->corners[CORNER_TOP_RIGHT] = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); c->title = XCreateSimpleWindow(dpy, c->frame, 0, 0, 1, 1, 0, 0, 0); for(i = 0; i < 4; i++) @@ -1530,10 +1530,10 @@ void clientFrame(Window w) clientAddToList(c); clientGrabKeys(c); - wc.x = c->x; - wc.y = c->y; - wc.width = c->width; - wc.height = c->height; + wc.x = c->x; + wc.y = c->y; + wc.width = c->width; + wc.height = c->height; wc.stack_mode = Above; clientConfigure(c, &wc, CWX | CWY | CWHeight | CWWidth | CWStackMode); @@ -1541,20 +1541,20 @@ void clientFrame(Window w) { clientShow(c, True); if(focus_new && !!clientAcceptFocus(c)) - { + { clientSetFocus(c, True); - } - else - { - frameDraw(c); - } + } + else + { + frameDraw(c); + } } else { c->hidden = True; frameDraw(c); setWMState(dpy, c->window, IconicState); - clientSetNetState(c); + clientSetNetState(c); } DBG("client_count=%d\n", client_count); @@ -1565,8 +1565,8 @@ void clientUnframe(Client * c, int remap) DBG("entering clientUnframe\n"); DBG("unframing client \"%s\" (%#lx)\n", c->name, c->window); - g_return_if_fail (c != NULL); - if (client_focus == c) + g_return_if_fail(c != NULL); + if(client_focus == c) { client_focus = NULL; } @@ -1592,9 +1592,9 @@ void clientUnframe(Client * c, int remap) { XFree(c->size); } - if (c->ncmap > 0) + if(c->ncmap > 0) { - XFree (c->cmap_windows); + XFree(c->cmap_windows); } free(c); workspaceUpdateArea(margins, gnome_margins); @@ -1610,22 +1610,22 @@ void clientFrameAll() DBG("entering clientFrameAll\n"); /* Since this fn is called at startup, it's safe to initialize some vars here */ - client_count = 0; - clients = NULL; - client_list = NULL; - client_list = NULL; - windows = NULL; + client_count = 0; + clients = NULL; + client_list = NULL; + client_list = NULL; + windows = NULL; windows_stack = NULL; - client_focus = NULL; - + client_focus = NULL; + XQueryTree(dpy, root, &w1, &w2, &wins, &count); for(i = 0; i < count; i++) { XGetWindowAttributes(dpy, wins[i], &attr); if((!attr.override_redirect) && (attr.map_state == IsViewable)) - { + { clientFrame(wins[i]); - } + } } if(wins) { @@ -1646,7 +1646,7 @@ void clientUnframeAll() { c = clientGetFromWindow(wins[i], FRAME); if(c) - { + { clientUnframe(c, True); } } @@ -1661,37 +1661,37 @@ Client *clientGetFromWindow(Window w, int mode) Client *c; int i; - g_return_val_if_fail (w != None, NULL); + g_return_val_if_fail(w != None, NULL); DBG("entering clientGetFromWindow\n"); DBG("looking for (%#lx)\n", w); for(c = clients, i = 0; i < client_count; c = c->next, i++) { switch (mode) - { - case WINDOW: - if (c->window == w) - { + { + case WINDOW: + if(c->window == w) + { DBG("found \"%s\" (mode WINDOW)\n", c->name); - return (c); - } - break; - case FRAME: - if (c->frame == w) - { + return (c); + } + break; + case FRAME: + if(c->frame == w) + { DBG("found \"%s\" (mode FRAME)\n", c->name); - return (c); - } - break; - case ANY: - default: - if ((c->frame == w) || (c->window == w)) - { + return (c); + } + break; + case ANY: + default: + if((c->frame == w) || (c->window == w)) + { DBG("found \"%s\" (mode ANY)\n", c->name); - return (c); - } - break; - } + return (c); + } + break; + } } DBG("no client found\n"); @@ -1702,39 +1702,39 @@ void clientShow(Client * c, int change_state) { int i; Client *c2; - - g_return_if_fail (c != NULL); + + g_return_if_fail(c != NULL); DBG("entering clientShow\n"); DBG("showing client \"%s\" (%#lx)\n", c->name, c->window); if((c->win_workspace == workspace) || (c->sticky)) { - for(c2 = c->next, i = 0; i < client_count; c2 = c2->next, i++) - { - if ((c2->transient_for == c->window) && (c2 != c)) - { - clientShow(c2, change_state); - } - } + for(c2 = c->next, i = 0; i < client_count; c2 = c2->next, i++) + { + if((c2->transient_for == c->window) && (c2 != c)) + { + clientShow(c2, change_state); + } + } XMapWindow(dpy, c->window); XMapWindow(dpy, c->frame); - c->visible = True; + c->visible = True; } if(change_state) { - c->hidden = False; + c->hidden = False; setWMState(dpy, c->window, NormalState); workspaceUpdateArea(margins, gnome_margins); } - clientSetNetState (c); + clientSetNetState(c); } void clientHide(Client * c, int change_state) { int i; Client *c2; - - g_return_if_fail (c != NULL); + + g_return_if_fail(c != NULL); DBG("entering clientHide\n"); DBG("hiding client \"%s\" (%#lx)\n", c->name, c->window); @@ -1742,12 +1742,12 @@ void clientHide(Client * c, int change_state) XUnmapWindow(dpy, c->frame); for(c2 = c->next, i = 0; i < client_count; c2 = c2->next, i++) { - if ((c2->transient_for == c->window) && (c2 != c)) - { - clientHide(c2, change_state); - } + if((c2->transient_for == c->window) && (c2 != c)) + { + clientHide(c2, change_state); + } } - + c->visible = False; if(change_state) { @@ -1756,35 +1756,35 @@ void clientHide(Client * c, int change_state) workspaceUpdateArea(margins, gnome_margins); } c->ignore_unmap++; - clientSetNetState (c); + clientSetNetState(c); } void clientHideAll(Client * c) { int i; Client *c2; - + DBG("entering clientHideAll\n"); for(c2 = c->next, i = 0; i < client_count; c2 = c2->next, i++) { - if ((c2 != c) && (c2->transient_for == None) && (c2->visible) && (c2->type == WINDOW_NORMAL) && (c2->has_border) && !(c2->skip_taskbar)) - { - if ((c) && (c->transient_for != c2->window)) - { - clientHide(c2, True); - } - else if (!c) - { - clientHide(c2, True); - } - } + if((c2 != c) && (c2->transient_for == None) && (c2->visible) && (c2->type == WINDOW_NORMAL) && (c2->has_border) && !(c2->skip_taskbar)) + { + if((c) && (c->transient_for != c2->window)) + { + clientHide(c2, True); + } + else if(!c) + { + clientHide(c2, True); + } + } } } void clientClose(Client * c) { - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientClose\n"); DBG("closing client \"%s\" (%#lx)\n", c->name, c->window); @@ -1793,7 +1793,7 @@ void clientClose(Client * c) void clientKill(Client * c) { - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientKill\n"); DBG("killing client \"%s\" (%#lx)\n", c->name, c->window); @@ -1804,11 +1804,11 @@ void clientRaise(Client * c) { XWindowChanges wc; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientRaise\n"); DBG("raising client \"%s\" (%#lx)\n", c->name, c->window); - if (c->managed) + if(c->managed) { wc.stack_mode = Above; clientConfigure(c, &wc, CWStackMode); @@ -1819,14 +1819,14 @@ void clientLower(Client * c) { XWindowChanges wc; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientLower\n"); DBG("lowering client \"%s\" (%#lx)\n", c->name, c->window); - - if (c->managed) + + if(c->managed) { - wc.stack_mode = Below; - clientConfigure(c, &wc, CWStackMode); + wc.stack_mode = Below; + clientConfigure(c, &wc, CWStackMode); } } @@ -1834,7 +1834,7 @@ void clientSetLayer(Client * c, int l) { int old_layer; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientSetLayer\n"); DBG("setting client \"%s\" (%#lx) layer to %d\n", c->name, c->window, l); @@ -1860,8 +1860,8 @@ void clientSetLayer(Client * c, int l) void clientSetWorkspace(Client * c, int ws) { unsigned long desk; - - g_return_if_fail (c != NULL); + + g_return_if_fail(c != NULL); DBG("entering clientSetWorkspace\n"); DBG("setting client \"%s\" (%#lx) to workspace %d\n", c->name, c->window, ws); @@ -1871,8 +1871,8 @@ void clientSetWorkspace(Client * c, int ws) } setGnomeHint(dpy, c->window, win_workspace, ws); c->win_workspace = ws; - desk = clientGetNetWmDesktop (c); - setNetHint (dpy, c->window, net_wm_desktop, desk); + desk = clientGetNetWmDesktop(c); + setNetHint(dpy, c->window, net_wm_desktop, desk); if(getWMState(dpy, c->window) != IconicState) { if(c->sticky) @@ -1882,13 +1882,13 @@ void clientSetWorkspace(Client * c, int ws) else { if(ws == workspace) - { + { clientShow(c, False); } - else - { + else + { clientHide(c, False); - } + } } } } @@ -1897,11 +1897,11 @@ void clientToggleShaded(Client * c) { XWindowChanges wc; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientToggleShaded\n"); DBG("shading/unshading client \"%s\" (%#lx)\n", c->name, c->window); - if (!(c->shaded) && (!(c->has_border) || (c->fullscreen))) + if(!(c->shaded) && (!(c->has_border) || (c->fullscreen))) { DBG("cowardly refusing to shade \"%s\" (%#lx) because it has no border\n", c->name, c->window); return; @@ -1911,13 +1911,13 @@ void clientToggleShaded(Client * c) setGnomeHint(dpy, c->window, win_state, c->win_state); wc.width = c->width; wc.height = c->height; - clientSetNetState (c); + clientSetNetState(c); clientConfigure(c, &wc, CWWidth | CWHeight); } void clientStick(Client * c) { - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientStick\n"); DBG("sticking client \"%s\" (%#lx)\n", c->name, c->window); @@ -1925,12 +1925,12 @@ void clientStick(Client * c) c->sticky = True; setGnomeHint(dpy, c->window, win_state, c->win_state); clientSetWorkspace(c, workspace); - clientSetNetState (c); + clientSetNetState(c); } void clientUnstick(Client * c) { - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientUnstick\n"); DBG("unsticking client \"%s\" (%#lx)\n", c->name, c->window); @@ -1938,16 +1938,16 @@ void clientUnstick(Client * c) c->sticky = False; setGnomeHint(dpy, c->window, win_state, c->win_state); clientSetWorkspace(c, workspace); - clientSetNetState (c); + clientSetNetState(c); } void clientToggleSticky(Client * c) { - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientToggleSticky\n"); DBG("sticking/unsticking client \"%s\" (%#lx)\n", c->name, c->window); - if (c->win_state & WIN_STATE_STICKY) + if(c->win_state & WIN_STATE_STICKY) { clientUnstick(c); } @@ -1961,13 +1961,11 @@ void clientToggleMaximized(Client * c, int mode) { XWindowChanges wc; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientToggleMaximized\n"); DBG("maximzing/unmaximizing client \"%s\" (%#lx)\n", c->name, c->window); - if((c->size->flags & (PMinSize | PMaxSize)) && - (c->size->min_width == c->size->max_width) && - (c->size->min_height == c->size->max_height)) + if((c->size->flags & (PMinSize | PMaxSize)) && (c->size->min_width == c->size->max_width) && (c->size->min_height == c->size->max_height)) { return; } @@ -2012,7 +2010,7 @@ void clientToggleMaximized(Client * c, int mode) } c->maximized = ((c->win_state & (WIN_STATE_MAXIMIZED_VERT | WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED)) ? True : False); setGnomeHint(dpy, c->window, win_state, c->win_state); - clientSetNetState (c); + clientSetNetState(c); clientConfigure(c, &wc, CWX | CWY | CWWidth | CWHeight); } @@ -2020,30 +2018,30 @@ void clientToggleFullscreen(Client * c) { XWindowChanges wc; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientToggleFullscreen\n"); DBG("toggle fullscreen client \"%s\" (%#lx)\n", c->name, c->window); if(c->fullscreen) { - c->fullscreen_old_x = c->x; - c->fullscreen_old_y = c->y; - c->fullscreen_old_width = c->width; + c->fullscreen_old_x = c->x; + c->fullscreen_old_y = c->y; + c->fullscreen_old_width = c->width; c->fullscreen_old_height = c->height; - wc.x = margins[MARGIN_LEFT]; - wc.y = margins[MARGIN_TOP]; - wc.width = XDisplayWidth(dpy, screen) - margins[MARGIN_LEFT] - margins[MARGIN_RIGHT]; + wc.x = margins[MARGIN_LEFT]; + wc.y = margins[MARGIN_TOP]; + wc.width = XDisplayWidth(dpy, screen) - margins[MARGIN_LEFT] - margins[MARGIN_RIGHT]; wc.height = XDisplayHeight(dpy, screen) - margins[MARGIN_TOP] - margins[MARGIN_BOTTOM]; } else { - wc.x = c->fullscreen_old_x; - wc.y = c->fullscreen_old_y; - wc.width = c->fullscreen_old_width; + wc.x = c->fullscreen_old_x; + wc.y = c->fullscreen_old_y; + wc.width = c->fullscreen_old_width; wc.height = c->fullscreen_old_height; } - clientSetNetState (c); + clientSetNetState(c); clientConfigure(c, &wc, CWX | CWY | CWWidth | CWHeight); } @@ -2060,37 +2058,37 @@ void clientUpdateFocus(Client * c) return; } client_focus = c; - clientInstallColormaps (c); - if (c) + clientInstallColormaps(c); + if(c) { - data[0] = c->window; + data[0] = c->window; } else { - data[0] = None; + data[0] = None; } - if (c2) + if(c2) { DBG("redrawing previous focus client \"%s\" (%#lx)\n", c2->name, c2->window); - frameDraw (c2); + frameDraw(c2); } data[1] = None; - XChangeProperty (dpy, root, net_active_window, XA_WINDOW, 32, PropModeReplace, (unsigned char*) data, 2); + XChangeProperty(dpy, root, net_active_window, XA_WINDOW, 32, PropModeReplace, (unsigned char *)data, 2); } -inline gboolean clientAcceptFocus(Client *c) +inline gboolean clientAcceptFocus(Client * c) { - g_return_val_if_fail (c != NULL, FALSE); + g_return_val_if_fail(c != NULL, FALSE); DBG("entering clientAcceptFocus\n"); /* First check GNOME protocol */ - if (c->win_hints & WIN_HINTS_SKIP_FOCUS) + if(c->win_hints & WIN_HINTS_SKIP_FOCUS) { return FALSE; } /* then try ICCCM */ - else if (c->wm_takefocus) + else if(c->wm_takefocus) { return TRUE; } @@ -2110,12 +2108,12 @@ void clientSetFocus(Client * c, int sort) { DBG("setting focus to client \"%s\" (%#lx)\n", c->name, c->window); if(!clientAcceptFocus(c)) - { + { DBG("SKIP_FOCUS set for client \"%s\" (%#lx)\n", c->name, c->window); return; } client_focus = c; - clientInstallColormaps (c); + clientInstallColormaps(c); if(sort) { DBG("Sorting...\n"); @@ -2133,22 +2131,22 @@ void clientSetFocus(Client * c, int sort) clients = c; } XSetInputFocus(dpy, c->window, RevertToNone, CurrentTime); - data[0] = c->window; + data[0] = c->window; } else { DBG("setting focus to none\n"); client_focus = NULL; XSetInputFocus(dpy, gnome_win, RevertToNone, CurrentTime); - data[0] = None; + data[0] = None; } - if (c2) + if(c2) { DBG("redrawing previous focus client \"%s\" (%#lx)\n", c2->name, c2->window); - frameDraw (c2); + frameDraw(c2); } data[1] = None; - XChangeProperty (dpy, root, net_active_window, XA_WINDOW, 32, PropModeReplace, (unsigned char*) data, 2); + XChangeProperty(dpy, root, net_active_window, XA_WINDOW, 32, PropModeReplace, (unsigned char *)data, 2); } Client *clientGetFocus(void) @@ -2161,17 +2159,17 @@ void clientDrawOutline(Client * c) DBG("entering clientDrawOutline\n"); XDrawRectangle(dpy, root, box_gc, frameX(c), frameY(c), frameWidth(c) - 1, frameHeight(c) - 1); - if ((c->has_border) && !(c->fullscreen) && !(c->shaded)) + if((c->has_border) && !(c->fullscreen) && !(c->shaded)) { XDrawRectangle(dpy, root, box_gc, c->x, c->y, c->width - 1, c->height - 1); } } -static GtkToXEventFilterStatus clientMove_event_filter(XEvent *xevent, gpointer data) +static GtkToXEventFilterStatus clientMove_event_filter(XEvent * xevent, gpointer data) { GtkToXEventFilterStatus status = XEV_FILTER_STOP; MoveResizeData *passdata = (MoveResizeData *) data; - Client *c = passdata->c; + Client *c = passdata->c; gboolean moving = TRUE; XWindowChanges wc; XEvent ev; @@ -2194,24 +2192,24 @@ static GtkToXEventFilterStatus clientMove_event_filter(XEvent *xevent, gpointer { if(xevent->xkey.keycode == keys[KEY_MOVE_LEFT].keycode) { - c->x = c->x - 16; + c->x = c->x - 16; } - if(xevent->xkey.keycode == keys[KEY_MOVE_RIGHT].keycode) + if(xevent->xkey.keycode == keys[KEY_MOVE_RIGHT].keycode) { - c->x = c->x + 16; + c->x = c->x + 16; } - } + } if(!(c->win_state & WIN_STATE_MAXIMIZED_VERT)) { if(xevent->xkey.keycode == keys[KEY_MOVE_UP].keycode) - { + { c->y = c->y - 16; } - if(xevent->xkey.keycode == keys[KEY_MOVE_DOWN].keycode) + if(xevent->xkey.keycode == keys[KEY_MOVE_DOWN].keycode) { - c->y = c->y + 16; + c->y = c->y + 16; } - } + } if(box_move) { clientDrawOutline(c); @@ -2252,7 +2250,7 @@ static GtkToXEventFilterStatus clientMove_event_filter(XEvent *xevent, gpointer getMouseXY(dpy, root, &msx, &msy); if(msx == 0 && !((workspace == 0) && !wrap_workspaces)) { - XEvent e; + XEvent e; workspaceSwitch(workspace - 1, c); XWarpPointer(dpy, None, root, 0, 0, 0, 0, XDisplayWidth(dpy, screen) - 11, msy); xevent->xmotion.x_root = XDisplayWidth(dpy, screen) - 11; @@ -2260,7 +2258,7 @@ static GtkToXEventFilterStatus clientMove_event_filter(XEvent *xevent, gpointer } else if((msx == XDisplayWidth(dpy, screen) - 1) && !((workspace == workspace_count - 1) && !wrap_workspaces)) { - XEvent e; + XEvent e; workspaceSwitch(workspace + 1, c); XWarpPointer(dpy, None, root, 0, 0, 0, 0, 10, msy); xevent->xmotion.x_root = 10; @@ -2274,11 +2272,11 @@ static GtkToXEventFilterStatus clientMove_event_filter(XEvent *xevent, gpointer if(snap_to_border) { if(abs(frameX(c) - margins[MARGIN_LEFT]) < snap_width) - { + { c->x = frameLeft(c) + margins[MARGIN_LEFT]; } if(abs(frameX(c) - XDisplayWidth(dpy, screen) + frameWidth(c) + margins[MARGIN_RIGHT]) < snap_width) - { + { c->x = (XDisplayWidth(dpy, screen) - frameRight(c) - c->width - margins[MARGIN_RIGHT]); } } @@ -2290,14 +2288,14 @@ static GtkToXEventFilterStatus clientMove_event_filter(XEvent *xevent, gpointer if(snap_to_border) { if(abs(frameY(c) - margins[MARGIN_TOP]) < snap_width) - { + { c->y = frameTop(c) + margins[MARGIN_TOP]; } - if(abs(frameY(c) - XDisplayHeight(dpy, screen) + frameHeight(c) + margins[MARGIN_BOTTOM]) < snap_width) + if(abs(frameY(c) - XDisplayHeight(dpy, screen) + frameHeight(c) + margins[MARGIN_BOTTOM]) < snap_width) { - c->y = (XDisplayHeight(dpy, screen) - margins[MARGIN_BOTTOM] - frameHeight(c) + frameTop(c)); + c->y = (XDisplayHeight(dpy, screen) - margins[MARGIN_BOTTOM] - frameHeight(c) + frameTop(c)); } - } + } } if(box_move) @@ -2329,10 +2327,10 @@ static GtkToXEventFilterStatus clientMove_event_filter(XEvent *xevent, gpointer } DBG("leaving clientMove_event_filter\n"); - if (!moving) + if(!moving) { DBG("event loop now finished\n"); - gtk_main_quit (); + gtk_main_quit(); } return status; @@ -2343,8 +2341,8 @@ void clientMove(Client * c, XEvent * e) XWindowChanges wc; MoveResizeData passdata; int g1, g2; - - g_return_if_fail (c != NULL); + + g_return_if_fail(c != NULL); DBG("entering clientDoMove\n"); DBG("moving client \"%s\" (%#lx)\n", c->name, c->window); @@ -2352,7 +2350,7 @@ void clientMove(Client * c, XEvent * e) { return; } - + passdata.c = c; passdata.use_keys = FALSE; passdata.grab = FALSE; @@ -2364,14 +2362,14 @@ void clientMove(Client * c, XEvent * e) { DBG("passdata.grab failed in clientMove\n"); if(g1 == GrabSuccess) - { + { XUngrabKeyboard(dpy, CurrentTime); } - if(g2 == GrabSuccess) + if(g2 == GrabSuccess) { - XUngrabPointer(dpy, CurrentTime); + XUngrabPointer(dpy, CurrentTime); } - return; + return; } if(e->type == KeyPress) @@ -2385,9 +2383,9 @@ void clientMove(Client * c, XEvent * e) passdata.oy = c->y; DBG("entering move loop\n"); - pushEventFilter (clientMove_event_filter, &passdata); - gtk_main (); - popEventFilter (); + pushEventFilter(clientMove_event_filter, &passdata); + gtk_main(); + popEventFilter(); DBG("leaving move loop\n"); XUngrabKeyboard(dpy, CurrentTime); @@ -2407,11 +2405,11 @@ void clientMove(Client * c, XEvent * e) } } -static GtkToXEventFilterStatus clientResize_event_filter(XEvent *xevent, gpointer data) +static GtkToXEventFilterStatus clientResize_event_filter(XEvent * xevent, gpointer data) { GtkToXEventFilterStatus status = XEV_FILTER_STOP; MoveResizeData *passdata = (MoveResizeData *) data; - Client *c = passdata->c; + Client *c = passdata->c; gboolean resizing = TRUE; XWindowChanges wc; @@ -2426,36 +2424,36 @@ static GtkToXEventFilterStatus clientResize_event_filter(XEvent *xevent, gpointe clientDrawOutline(c); } if(box_resize) - { + { clientDrawOutline(c); } - if(!(c->win_state & WIN_STATE_MAXIMIZED_VERT)) + if(!(c->win_state & WIN_STATE_MAXIMIZED_VERT)) { if(xevent->xkey.keycode == keys[KEY_MOVE_UP].keycode) - { + { c->height = c->height - (clientGetHeightInc(c) < 10 ? 10 : clientGetHeightInc(c)); } - if(xevent->xkey.keycode == keys[KEY_MOVE_DOWN].keycode) + if(xevent->xkey.keycode == keys[KEY_MOVE_DOWN].keycode) { - c->height = c->height + (clientGetHeightInc(c) < 10 ? 10 : clientGetHeightInc(c)); + c->height = c->height + (clientGetHeightInc(c) < 10 ? 10 : clientGetHeightInc(c)); } } if(!(c->win_state & WIN_STATE_MAXIMIZED_HORIZ)) { if(xevent->xkey.keycode == keys[KEY_MOVE_LEFT].keycode) { - c->width = c->width - (clientGetWidthInc(c) < 10 ? 10 : clientGetWidthInc(c)); + c->width = c->width - (clientGetWidthInc(c) < 10 ? 10 : clientGetWidthInc(c)); } - if(xevent->xkey.keycode == keys[KEY_MOVE_RIGHT].keycode) - { + if(xevent->xkey.keycode == keys[KEY_MOVE_RIGHT].keycode) + { c->width = c->width + (clientGetWidthInc(c) < 10 ? 10 : clientGetWidthInc(c)); } - } + } if(box_resize) - { + { clientDrawOutline(c); } - else + else { wc.x = c->x; wc.y = c->y; @@ -2468,8 +2466,8 @@ static GtkToXEventFilterStatus clientResize_event_filter(XEvent *xevent, gpointe { if(IsModifierKey(XKeycodeToKeysym(dpy, xevent->xkey.keycode, 0))) { - resizing = FALSE; - } + resizing = FALSE; + } } else if(xevent->type == MotionNotify) { @@ -2483,47 +2481,47 @@ static GtkToXEventFilterStatus clientResize_event_filter(XEvent *xevent, gpointe } if(box_resize) { - clientDrawOutline(c); + clientDrawOutline(c); } - passdata->oldw = c->width; + passdata->oldw = c->width; passdata->oldh = c->height; if(!(c->win_state & WIN_STATE_MAXIMIZED_HORIZ)) { if((passdata->corner == CORNER_TOP_LEFT) || (passdata->corner == CORNER_BOTTOM_LEFT) || (passdata->corner == 4 + SIDE_LEFT)) { - c->width = (c->x + c->width) - xevent->xmotion.x_root + passdata->mx - frameLeft(c); + c->width = (c->x + c->width) - xevent->xmotion.x_root + passdata->mx - frameLeft(c); } - if((passdata->corner == CORNER_BOTTOM_RIGHT) || (passdata->corner == CORNER_TOP_RIGHT) || (passdata->corner == 4 + SIDE_RIGHT)) + if((passdata->corner == CORNER_BOTTOM_RIGHT) || (passdata->corner == CORNER_TOP_RIGHT) || (passdata->corner == 4 + SIDE_RIGHT)) { - c->width = (xevent->xmotion.x_root - c->x) + passdata->mx - frameRight(c); + c->width = (xevent->xmotion.x_root - c->x) + passdata->mx - frameRight(c); } - } + } if(!((c->win_state & WIN_STATE_MAXIMIZED_VERT) || (c->win_state & WIN_STATE_SHADED))) { if((passdata->corner == CORNER_TOP_LEFT) || (passdata->corner == CORNER_TOP_RIGHT)) { - c->height = (c->y + c->height) - xevent->xmotion.y_root + passdata->my - frameTop(c); + c->height = (c->y + c->height) - xevent->xmotion.y_root + passdata->my - frameTop(c); } - if((passdata->corner == CORNER_BOTTOM_RIGHT) || (passdata->corner == CORNER_BOTTOM_LEFT) || (passdata->corner == 4 + SIDE_BOTTOM)) - { + if((passdata->corner == CORNER_BOTTOM_RIGHT) || (passdata->corner == CORNER_BOTTOM_LEFT) || (passdata->corner == 4 + SIDE_BOTTOM)) + { c->height = (xevent->xmotion.y_root - c->y) + passdata->my - frameBottom(c); } - } + } clientSetWidth(c, c->width); clientSetHeight(c, c->height); if(!(c->win_state & WIN_STATE_MAXIMIZED_HORIZ) && ((passdata->corner == CORNER_TOP_LEFT) || (passdata->corner == CORNER_BOTTOM_LEFT) || (passdata->corner == 4 + SIDE_LEFT))) - { + { c->x = c->x - (c->width - passdata->oldw); } - if(!((c->win_state & WIN_STATE_MAXIMIZED_VERT) || (c->win_state & WIN_STATE_SHADED)) && (passdata->corner == CORNER_TOP_LEFT || passdata->corner == CORNER_TOP_RIGHT)) + if(!((c->win_state & WIN_STATE_MAXIMIZED_VERT) || (c->win_state & WIN_STATE_SHADED)) && (passdata->corner == CORNER_TOP_LEFT || passdata->corner == CORNER_TOP_RIGHT)) { - c->y = c->y - (c->height - passdata->oldh); + c->y = c->y - (c->height - passdata->oldh); } - if(box_resize) + if(box_resize) { - clientDrawOutline(c); + clientDrawOutline(c); } - else + else { wc.x = c->x; wc.y = c->y; @@ -2550,10 +2548,10 @@ static GtkToXEventFilterStatus clientResize_event_filter(XEvent *xevent, gpointe } DBG("leaving clientResize_event_filter\n"); - if (!resizing) + if(!resizing) { DBG("event loop now finished\n"); - gtk_main_quit (); + gtk_main_quit(); } return status; @@ -2565,7 +2563,7 @@ void clientResize(Client * c, int corner, XEvent * e) MoveResizeData passdata; int g1, g2; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientResize\n"); DBG("resizing client \"%s\" (%#lx)\n", c->name, c->window); @@ -2573,13 +2571,13 @@ void clientResize(Client * c, int corner, XEvent * e) { return; } - + passdata.c = c; passdata.corner = CORNER_BOTTOM_RIGHT; passdata.use_keys = FALSE; passdata.grab = FALSE; passdata.corner = corner; - + getMouseXY(dpy, c->frame, &passdata.mx, &passdata.my); if(e->type == KeyPress) { @@ -2592,23 +2590,23 @@ void clientResize(Client * c, int corner, XEvent * e) if((g1 != GrabSuccess) || (g2 != GrabSuccess)) { DBG("grab failed in clientResize\n"); - gdk_beep (); + gdk_beep(); if(g1 == GrabSuccess) { - XUngrabKeyboard(dpy, CurrentTime); + XUngrabKeyboard(dpy, CurrentTime); } - if(g2 == GrabSuccess) + if(g2 == GrabSuccess) { - XUngrabPointer(dpy, CurrentTime); + XUngrabPointer(dpy, CurrentTime); } - return; + return; } if(passdata.use_keys) { XPutBackEvent(dpy, e); } - if((passdata.corner == CORNER_TOP_RIGHT) || (passdata.corner == CORNER_BOTTOM_RIGHT) || (passdata.corner == 4+ SIDE_RIGHT)) + if((passdata.corner == CORNER_TOP_RIGHT) || (passdata.corner == CORNER_BOTTOM_RIGHT) || (passdata.corner == 4 + SIDE_RIGHT)) { passdata.mx = frameWidth(c) - passdata.mx; } @@ -2617,9 +2615,9 @@ void clientResize(Client * c, int corner, XEvent * e) passdata.my = frameHeight(c) - passdata.my; } DBG("entering resize loop\n"); - pushEventFilter (clientResize_event_filter, &passdata); - gtk_main (); - popEventFilter (); + pushEventFilter(clientResize_event_filter, &passdata); + gtk_main(); + popEventFilter(); DBG("leaving resize loop\n"); XUngrabKeyboard(dpy, CurrentTime); @@ -2656,17 +2654,17 @@ Client *clientGetNext(Client * c, int mask) okay = True; if((!clientAcceptFocus(c2)) && !(mask & INCLUDE_SKIP_FOCUS)) { - okay = False; + okay = False; } - if((c2->hidden) && !(mask & INCLUDE_HIDDEN)) + if((c2->hidden) && !(mask & INCLUDE_HIDDEN)) { okay = False; } - if((c2->skip_pager) && !(mask & INCLUDE_SKIP_PAGER)) + if((c2->skip_pager) && !(mask & INCLUDE_SKIP_PAGER)) { okay = False; } - if((c2->skip_taskbar) && !(mask & INCLUDE_SKIP_TASKBAR)) + if((c2->skip_taskbar) && !(mask & INCLUDE_SKIP_TASKBAR)) { okay = False; } @@ -2683,11 +2681,11 @@ Client *clientGetNext(Client * c, int mask) return NULL; } -static GtkToXEventFilterStatus clientCycle_event_filter(XEvent *xevent, gpointer data) +static GtkToXEventFilterStatus clientCycle_event_filter(XEvent * xevent, gpointer data) { GtkToXEventFilterStatus status = XEV_FILTER_STOP; gboolean cycling = TRUE; - Client **c2 = (Client **) data; + Client **c2 = (Client **) data; DBG("entering clientCycle_event_filter\n"); switch (xevent->type) @@ -2695,45 +2693,45 @@ static GtkToXEventFilterStatus clientCycle_event_filter(XEvent *xevent, gpointer case KeyPress: if(xevent->xkey.keycode == keys[KEY_CYCLE_WINDOWS].keycode) { - if(getWMState(dpy, (*c2)->window) == IconicState) - { + if(getWMState(dpy, (*c2)->window) == IconicState) + { clientHide(*c2, False); - } - *c2 = clientGetNext(*c2, INCLUDE_HIDDEN); - if(*c2) - { - clientShow(*c2, False); - clientRaise(*c2); - clientSetFocus(*c2, False); - } - else - { - cycling = FALSE; - } - - } - break; + } + *c2 = clientGetNext(*c2, INCLUDE_HIDDEN); + if(*c2) + { + clientShow(*c2, False); + clientRaise(*c2); + clientSetFocus(*c2, False); + } + else + { + cycling = FALSE; + } + + } + break; case KeyRelease: if(IsModifierKey(XKeycodeToKeysym(dpy, xevent->xkey.keycode, 0))) { - cycling = FALSE; + cycling = FALSE; } - break; - case ButtonPress: - case ButtonRelease: - case EnterNotify: - case LeaveNotify: - case MotionNotify: - break; - default: + break; + case ButtonPress: + case ButtonRelease: + case EnterNotify: + case LeaveNotify: + case MotionNotify: + break; + default: status = XEV_FILTER_CONTINUE; - break; + break; } - if (!cycling) + if(!cycling) { DBG("event loop now finished\n"); - gtk_main_quit (); + gtk_main_quit(); } return status; @@ -2744,7 +2742,7 @@ void clientCycle(Client * c) Client *c2; int g1, g2; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientCycle\n"); g1 = XGrabKeyboard(dpy, gnome_win, False, GrabModeAsync, GrabModeAsync, CurrentTime); @@ -2752,28 +2750,28 @@ void clientCycle(Client * c) if((g1 != GrabSuccess) || (g2 != GrabSuccess)) { DBG("grab failed in clientCycle\n"); - gdk_beep (); + gdk_beep(); if(g1 == GrabSuccess) - { + { XUngrabKeyboard(dpy, CurrentTime); } - if(g2 == GrabSuccess) + if(g2 == GrabSuccess) { - XUngrabPointer(dpy, CurrentTime); + XUngrabPointer(dpy, CurrentTime); } - return; + return; } c2 = clientGetNext(c, INCLUDE_HIDDEN); if(c2) { - clientShow(c2, False); - clientRaise(c2); - clientSetFocus(c2, False); + clientShow(c2, False); + clientRaise(c2); + clientSetFocus(c2, False); DBG("entering cycle loop\n"); - pushEventFilter (clientCycle_event_filter, &c2); - gtk_main (); - popEventFilter (); + pushEventFilter(clientCycle_event_filter, &c2); + gtk_main(); + popEventFilter(); DBG("leaving cycle loop\n"); } @@ -2787,12 +2785,12 @@ void clientCycle(Client * c) } } -static GtkToXEventFilterStatus clientButtonPress_event_filter(XEvent *xevent, gpointer data) +static GtkToXEventFilterStatus clientButtonPress_event_filter(XEvent * xevent, gpointer data) { GtkToXEventFilterStatus status = XEV_FILTER_STOP; gboolean pressed = TRUE; - Client *c = ((ButtonPressData *) data)->c; - int b = ((ButtonPressData *) data)->b; + Client *c = ((ButtonPressData *) data)->c; + int b = ((ButtonPressData *) data)->b; if(xevent->type == EnterNotify) { @@ -2820,11 +2818,11 @@ static GtkToXEventFilterStatus clientButtonPress_event_filter(XEvent *xevent, gp { status = XEV_FILTER_CONTINUE; } - - if (!pressed) + + if(!pressed) { DBG("event loop now finished\n"); - gtk_main_quit (); + gtk_main_quit(); } return status; @@ -2835,15 +2833,15 @@ void clientButtonPress(Client * c, Window w, XButtonEvent * bev) int b, g1, g2; ButtonPressData passdata; - g_return_if_fail (c != NULL); + g_return_if_fail(c != NULL); DBG("entering clientButtonPress\n"); for(b = 0; b < BUTTON_COUNT; b++) { if(c->buttons[b] == w) { - break; - } + break; + } } g1 = XGrabKeyboard(dpy, c->window, False, GrabModeAsync, GrabModeAsync, CurrentTime); @@ -2852,16 +2850,16 @@ void clientButtonPress(Client * c, Window w, XButtonEvent * bev) if(g1 != GrabSuccess || g2 != GrabSuccess) { DBG("grab failed in clientButtonPress\n"); - gdk_beep (); + gdk_beep(); if(g1 == GrabSuccess) { - XUngrabKeyboard(dpy, CurrentTime); + XUngrabKeyboard(dpy, CurrentTime); } - if(g2 == GrabSuccess) + if(g2 == GrabSuccess) { - XUngrabPointer(dpy, CurrentTime); + XUngrabPointer(dpy, CurrentTime); } - return; + return; } passdata.c = c; @@ -2871,9 +2869,9 @@ void clientButtonPress(Client * c, Window w, XButtonEvent * bev) frameDraw(c); DBG("entering button press loop\n"); - pushEventFilter (clientButtonPress_event_filter, &passdata); - gtk_main (); - popEventFilter (); + pushEventFilter(clientButtonPress_event_filter, &passdata); + gtk_main(); + popEventFilter(); DBG("leaving button press loop\n"); XUngrabPointer(dpy, CurrentTime); @@ -2890,14 +2888,14 @@ void clientButtonPress(Client * c, Window w, XButtonEvent * bev) break; case CLOSE_BUTTON: if(bev->button == Button3) - { + { clientKill(c); } - else + else { - clientClose(c); + clientClose(c); } - break; + break; case MAXIMIZE_BUTTON: if(bev->button == Button1) { diff --git a/src/client.h b/src/client.h index a30032940..b520fb0d6 100644 --- a/src/client.h +++ b/src/client.h @@ -156,7 +156,8 @@ typedef enum WINDOW_MENU, WINDOW_UTILITY, WINDOW_SPLASHSCREEN -} WindowType; +} +WindowType; typedef struct _Client Client; @@ -198,30 +199,30 @@ struct _Client int struts[4]; char *name; unsigned int ignore_unmap; - unsigned int managed : 1; - unsigned int focus : 1; - unsigned int has_border : 1; - unsigned int sticky : 1; - unsigned int maximized : 1; - unsigned int fullscreen : 1; - unsigned int shaded : 1; - unsigned int visible : 1; - unsigned int hidden : 1; - unsigned int state_modal : 1; - unsigned int skip_taskbar : 1; - unsigned int skip_pager : 1; - unsigned int has_struts : 1; - unsigned int wm_takefocus : 1; - unsigned int wm_input : 1; + unsigned int managed:1; + unsigned int focus:1; + unsigned int has_border:1; + unsigned int sticky:1; + unsigned int maximized:1; + unsigned int fullscreen:1; + unsigned int shaded:1; + unsigned int visible:1; + unsigned int hidden:1; + unsigned int state_modal:1; + unsigned int skip_taskbar:1; + unsigned int skip_pager:1; + unsigned int has_struts:1; + unsigned int wm_takefocus:1; + unsigned int wm_input:1; }; extern Client *clients; extern Window *client_list; extern unsigned int client_count; -void clientSetNetState (Client *); -void clientUpdateNetState (Client *, XClientMessageEvent *); -void clientGetNetWmType (Client *c); +void clientSetNetState(Client *); +void clientUpdateNetState(Client *, XClientMessageEvent *); +void clientGetNetWmType(Client * c); void clientGravitate(Client *, int); void clientConfigure(Client *, XWindowChanges *, int); void clientFrame(Window); @@ -229,8 +230,8 @@ void clientUnframe(Client *, int); void clientFrameAll(); void clientUnframeAll(); void clientGetNetStruts(Client *); -void clientInstallColormaps (Client *); -void clientUpdateColormaps (Client *); +void clientInstallColormaps(Client *); +void clientUpdateColormaps(Client *); void clientGrabKeys(Client *); void clientUngrabKeys(Client *); Client *clientGetFromWindow(Window, int); @@ -250,7 +251,7 @@ void clientToggleSticky(Client *); void clientToggleMaximized(Client *, int); void clientToggleFullscreen(Client *); void clientUpdateFocus(Client *); -inline gboolean clientAcceptFocus(Client *c); +inline gboolean clientAcceptFocus(Client * c); void clientSetFocus(Client *, int); Client *clientGetFocus(); void clientMove(Client *, XEvent *); diff --git a/src/events.c b/src/events.c index df9b39863..a21406ef2 100644 --- a/src/events.c +++ b/src/events.c @@ -39,25 +39,25 @@ static guint raise_timeout = 0; static gulong button_handler_id = 0; static GdkAtom atom_rcfiles = GDK_NONE; -static void menu_callback (Menu *menu, MenuOp op, Window client_xwindow, gpointer menu_data, gpointer item_data); -static gboolean show_popup_cb (GtkWidget *widget, GdkEventButton *ev, gpointer data); -static gboolean client_event_cb (GtkWidget *widget, GdkEventClient *ev); +static void menu_callback(Menu * menu, MenuOp op, Window client_xwindow, gpointer menu_data, gpointer item_data); +static gboolean show_popup_cb(GtkWidget * widget, GdkEventButton * ev, gpointer data); +static gboolean client_event_cb(GtkWidget * widget, GdkEventClient * ev); -static void clear_timeout (void) +static void clear_timeout(void) { - if (raise_timeout) + if(raise_timeout) { - gtk_timeout_remove (raise_timeout); - raise_timeout = 0; + gtk_timeout_remove(raise_timeout); + raise_timeout = 0; } } -static gboolean raise_cb (gpointer data) +static gboolean raise_cb(gpointer data) { Client *c; DBG("entering raise_cb\n"); - clear_timeout (); + clear_timeout(); c = clientGetFocus(); if(c) { @@ -66,13 +66,13 @@ static gboolean raise_cb (gpointer data) return (TRUE); } -static void reset_timeout (void) +static void reset_timeout(void) { - if (raise_timeout) + if(raise_timeout) { - gtk_timeout_remove (raise_timeout); + gtk_timeout_remove(raise_timeout); } - raise_timeout = gtk_timeout_add (raise_delay, (GtkFunction) raise_cb, NULL); + raise_timeout = gtk_timeout_add(raise_delay, (GtkFunction) raise_cb, NULL); } static inline void handleKeyPress(XKeyEvent * ev) @@ -88,11 +88,11 @@ static inline void handleKeyPress(XKeyEvent * ev) for(key = 0; key < KEY_COUNT; key++) { if((keys[key].keycode == ev->keycode) && (keys[key].modifier == state)) - { + { break; - } + } } - + if(c) { switch (key) @@ -101,10 +101,10 @@ static inline void handleKeyPress(XKeyEvent * ev) case KEY_MOVE_DOWN: case KEY_MOVE_LEFT: case KEY_MOVE_RIGHT: - if ((c->has_border) && !(c->fullscreen)) - { + if((c->has_border) && !(c->fullscreen)) + { clientMove(c, (XEvent *) ev); - } + } break; case KEY_RESIZE_UP: case KEY_RESIZE_DOWN: @@ -221,10 +221,10 @@ static inline void handleKeyPress(XKeyEvent * ev) switch (key) { case KEY_CYCLE_WINDOWS: - if(clients) - { + if(clients) + { clientCycle(clients->prev); - } + } break; case KEY_NEXT_WORKSPACE: workspaceSwitch(workspace + 1, NULL); @@ -281,7 +281,7 @@ static inline void handleButtonPress(XButtonEvent * ev) DBG("entering handleButtonPress\n"); /* Clear timeout */ - clear_timeout (); + clear_timeout(); c = clientGetFromWindow(ev->window, FRAME); if(c) @@ -300,12 +300,12 @@ static inline void handleButtonPress(XButtonEvent * ev) else if(((win == c->title) && (ev->button == Button3)) || ((win == c->buttons[MENU_BUTTON]) && (ev->button == Button1))) { clientRaise(c); - ev->window = ev->root; - if (button_handler_id) - { - g_signal_handler_disconnect (GTK_OBJECT (getDefaultGtkWidget()), button_handler_id); - } - button_handler_id = g_signal_connect (GTK_OBJECT (getDefaultGtkWidget()), "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) c); + ev->window = ev->root; + if(button_handler_id) + { + g_signal_handler_disconnect(GTK_OBJECT(getDefaultGtkWidget()), button_handler_id); + } + button_handler_id = g_signal_connect(GTK_OBJECT(getDefaultGtkWidget()), "button_press_event", GTK_SIGNAL_FUNC(show_popup_cb), (gpointer) c); /* Let GTK handle this for us. */ } else if(((win == c->title) && ((ev->button == Button1) && (state == 0))) || ((ev->button == Button1) && (state == Mod1Mask))) @@ -329,10 +329,10 @@ static inline void handleButtonPress(XButtonEvent * ev) } else { - if ((c->has_border) && !(c->fullscreen)) - { - clientMove(c, (XEvent *) ev); - } + if((c->has_border) && !(c->fullscreen)) + { + clientMove(c, (XEvent *) ev); + } last_button_time = ev->time; } } @@ -373,31 +373,31 @@ static inline void handleButtonPress(XButtonEvent * ev) } else if(((win != c->window) && (ev->button == Button2) && (state == 0)) || ((ev->button == Button2) && (state == (Mod1Mask | ControlMask)))) { - clientLower(c); + clientLower(c); } - else + else { clientRaise(c); if(win == c->window) - { + { replay = True; } - } + } if(replay) - { + { XAllowEvents(dpy, ReplayPointer, CurrentTime); } - else + else { - XAllowEvents(dpy, SyncPointer, CurrentTime); + XAllowEvents(dpy, SyncPointer, CurrentTime); } } else { XUngrabPointer(dpy, CurrentTime); XSendEvent(dpy, gnome_win, False, SubstructureNotifyMask, (XEvent *) ev); - XSync(dpy, False); + XSync(dpy, False); } } @@ -420,13 +420,13 @@ static inline void handleDestroyNotify(XDestroyWindowEvent * ev) { clientUnframe(c, False); if(clients) - { + { clientSetFocus(clientGetNext(clients->prev, 0), True); } - else + else { - clientSetFocus(NULL, True); - } + clientSetFocus(NULL, True); + } } } @@ -440,20 +440,20 @@ static inline void handleUnmapNotify(XUnmapEvent * ev) if(c) { if(c->ignore_unmap) - { + { c->ignore_unmap--; } - else + else { clientUnframe(c, False); if(clients) - { + { clientSetFocus(clientGetNext(clients->prev, 0), True); } - else - { + else + { clientSetFocus(NULL, True); - } + } } } } @@ -464,7 +464,7 @@ static inline void handleMapRequest(XMapRequestEvent * ev) DBG("entering handleMapRequest\n"); - if (ev->window == None) + if(ev->window == None) { DBG("Mapping None ???\n"); return; @@ -533,12 +533,12 @@ static inline void handleFocusIn(XFocusChangeEvent * ev) DBG("entering handleFocusIn\n"); DBG("FocusIn window is (%#lx)\n", ev->window); - if (ev->window == gnome_win) + if(ev->window == gnome_win) { /* Don't get fooled by our own gtk window ! */ return; } - + c = clientGetFromWindow(ev->window, WINDOW); if(c) { @@ -546,9 +546,9 @@ static inline void handleFocusIn(XFocusChangeEvent * ev) clientUpdateFocus(c); frameDraw(c); if(raise_on_focus) - { - reset_timeout (); - } + { + reset_timeout(); + } } else if(clients) { @@ -580,34 +580,34 @@ static inline void handlePropertyNotify(XPropertyEvent * ev) if(ev->atom == XA_WM_NORMAL_HINTS) { DBG("client \"%s\" (%#lx) has received a XA_WM_NORMAL_HINTS notify\n", c->name, c->window); - XGetWMNormalHints(dpy, c->window, c->size, &dummy); + XGetWMNormalHints(dpy, c->window, c->size, &dummy); } - else if((ev->atom == XA_WM_NAME) || (ev->atom == net_wm_name)) + else if((ev->atom == XA_WM_NAME) || (ev->atom == net_wm_name)) { DBG("client \"%s\" (%#lx) has received a XA_WM_NAME notify\n", c->name, c->window); if(c->name) - { + { free(c->name); } - getWindowName(dpy, c->window, &c->name); + getWindowName(dpy, c->window, &c->name); frameDraw(c); } else if(ev->atom == win_hints) { DBG("client \"%s\" (%#lx) has received a win_hints notify\n", c->name, c->window); - getGnomeHint(dpy, c->window, win_hints, &c->win_hints); + getGnomeHint(dpy, c->window, win_hints, &c->win_hints); } - else if (ev->atom == win_layer) + else if(ev->atom == win_layer) { DBG("client \"%s\" (%#lx) has received a win_layer notify\n", c->name, c->window); getGnomeHint(dpy, c->window, win_layer, &dummy); clientSetLayer(c, dummy); - clientSetNetState (c); + clientSetNetState(c); } - else if (ev->atom == net_wm_window_type) + else if(ev->atom == net_wm_window_type) { DBG("client \"%s\" (%#lx) has received a net_wm_window_type notify\n", c->name, c->window); - clientGetNetWmType (c); + clientGetNetWmType(c); } else if(ev->atom == win_workspace) { @@ -615,19 +615,19 @@ static inline void handlePropertyNotify(XPropertyEvent * ev) getGnomeHint(dpy, c->window, win_workspace, &dummy); clientSetWorkspace(c, dummy); } - else if (ev->atom == net_wm_strut) + else if(ev->atom == net_wm_strut) { DBG("client \"%s\" (%#lx) has received a net_wm_strut notify\n", c->name, c->window); - clientGetNetStruts(c); + clientGetNetStruts(c); } - else if (ev->atom == wm_colormap_windows) - { - clientUpdateColormaps(c); - if (c == clientGetFocus()) - { + else if(ev->atom == wm_colormap_windows) + { + clientUpdateColormaps(c); + if(c == clientGetFocus()) + { clientInstallColormaps(c); - } - } + } + } } else { @@ -640,9 +640,9 @@ static inline void handlePropertyNotify(XPropertyEvent * ev) else if(ev->atom == gnome_panel_desktop_area) { DBG("root has received a gnome_panel_desktop_area notify\n"); - getGnomeDesktopMargins(dpy, gnome_margins); + getGnomeDesktopMargins(dpy, gnome_margins); workspaceUpdateArea(margins, gnome_margins); - } + } } } @@ -656,79 +656,79 @@ static inline void handleClientMessage(XClientMessageEvent * ev) if(c) { if((ev->message_type == wm_change_state) && (ev->format == 32) && (ev->data.l[0] == IconicState)) - { + { DBG("client \"%s\" (%#lx) has received a wm_change_state event\n", c->name, c->window); clientHide(c, True); } else if((ev->message_type == win_state) && (ev->format == 32) && (ev->data.l[0] & WIN_STATE_SHADED)) - { + { DBG("client \"%s\" (%#lx) has received a win_state/shaded event\n", c->name, c->window); clientToggleShaded(c); } - else if((ev->message_type == win_state) && (ev->format == 32) && (ev->data.l[0] & WIN_STATE_STICKY)) + else if((ev->message_type == win_state) && (ev->format == 32) && (ev->data.l[0] & WIN_STATE_STICKY)) { DBG("client \"%s\" (%#lx) has received a win_state/stick event\n", c->name, c->window); - clientToggleSticky(c); + clientToggleSticky(c); } - else if((ev->message_type == win_layer) && (ev->format == 32)) - { + else if((ev->message_type == win_layer) && (ev->format == 32)) + { DBG("client \"%s\" (%#lx) has received a win_layer event\n", c->name, c->window); clientSetLayer(c, ev->data.l[0]); } - else if((ev->message_type == win_workspace) && (ev->format == 32)) - { + else if((ev->message_type == win_workspace) && (ev->format == 32)) + { DBG("client \"%s\" (%#lx) has received a win_workspace event\n", c->name, c->window); clientSetWorkspace(c, ev->data.l[0]); - } - else if((ev->message_type == net_wm_desktop) && (ev->format == 32)) - { + } + else if((ev->message_type == net_wm_desktop) && (ev->format == 32)) + { DBG("client \"%s\" (%#lx) has received a net_wm_desktop event\n", c->name, c->window); - if ((ev->data.l[0] == (int) 0xFFFFFFFF)) - { - clientStick(c); - } - else - { - clientUnstick(c); - } - } + if((ev->data.l[0] == (int)0xFFFFFFFF)) + { + clientStick(c); + } + else + { + clientUnstick(c); + } + } else if((ev->message_type == net_close_window) && (ev->format == 32)) - { + { DBG("client \"%s\" (%#lx) has received a net_close_window event\n", c->name, c->window); - clientClose (c); - } + clientClose(c); + } else if((ev->message_type == net_wm_state) && (ev->format == 32)) { DBG("client \"%s\" (%#lx) has received a net_wm_state event\n", c->name, c->window); - clientUpdateNetState (c, ev); - } + clientUpdateNetState(c, ev); + } else if((ev->message_type == net_wm_moveresize) && (ev->format == 32)) { DBG("client \"%s\" (%#lx) has received a net_wm_moveresize event\n", c->name, c->window); - g_message ("Operation not supported (yet)\n"); - /* TBD */ - } + g_message("Operation not supported (yet)\n"); + /* TBD */ + } else if((ev->message_type == net_active_window) && (ev->format == 32)) { DBG("client \"%s\" (%#lx) has received a net_active_window event\n", c->name, c->window); - workspaceSwitch(c->win_workspace, NULL); - clientShow (c, True); - clientRaise (c); - clientSetFocus(c, True); - } + workspaceSwitch(c->win_workspace, NULL); + clientShow(c, True); + clientRaise(c); + clientSetFocus(c, True); + } } else { if(((ev->message_type == win_workspace) || (ev->message_type == net_current_desktop)) && (ev->format == 32)) - { + { DBG("root has received a win_workspace or a net_current_desktop event\n"); workspaceSwitch(ev->data.l[0], NULL); } - else if(((ev->message_type == win_workspace_count) || (ev->message_type == net_number_of_desktops)) && (ev->format == 32)) - { + else if(((ev->message_type == win_workspace_count) || (ev->message_type == net_number_of_desktops)) && (ev->format == 32)) + { DBG("root has received a win_workspace_count event\n"); workspaceSetCount(ev->data.l[0]); - } + } } } @@ -745,19 +745,19 @@ static inline void handleShape(XShapeEvent * ev) } } -static inline void handleColormapNotify(XColormapEvent *ev) +static inline void handleColormapNotify(XColormapEvent * ev) { Client *c; - + DBG("entering handleColormapNotify\n"); - + c = clientGetFromWindow(ev->window, WINDOW); - if ((c) && (ev->window == c->window) && (ev->new)) + if((c) && (ev->window == c->window) && (ev->new)) { - if (c == clientGetFocus()) - { - clientInstallColormaps (c); - } + if(c == clientGetFocus()) + { + clientInstallColormaps(c); + } } } @@ -808,26 +808,26 @@ void handleEvent(XEvent * ev) break; default: if(shape && (ev->type == shape_event)) - { + { handleShape((XShapeEvent *) ev); - } + } } - if (!gdk_events_pending() && !XPending(dpy)) + if(!gdk_events_pending() && !XPending(dpy)) { - if(reload) - { + if(reload) + { reloadSettings(); reload = False; - } - else if(quit) - { + } + else if(quit) + { gtk_main_quit(); - } + } } } -GtkToXEventFilterStatus xfwm4_event_filter(XEvent *xevent, gpointer data) +GtkToXEventFilterStatus xfwm4_event_filter(XEvent * xevent, gpointer data) { DBG("entering xfwm4_event_filter\n"); handleEvent(xevent); @@ -837,178 +837,178 @@ GtkToXEventFilterStatus xfwm4_event_filter(XEvent *xevent, gpointer data) /* GTK stuff (menu, etc...) */ -static void menu_callback (Menu *menu, MenuOp op, Window client_xwindow, gpointer menu_data, gpointer item_data) +static void menu_callback(Menu * menu, MenuOp op, Window client_xwindow, gpointer menu_data, gpointer item_data) { Client *c = NULL; - + DBG("entering menu_callback\n"); - if (menu_data) + if(menu_data) { - c = (Client *) menu_data; - c = clientGetFromWindow(c->window, WINDOW); - if (c) - { + c = (Client *) menu_data; + c = clientGetFromWindow(c->window, WINDOW); + if(c) + { c->button_pressed[MENU_BUTTON] = False; - } + } } - + switch (op) { - case MENU_OP_QUIT: - gtk_main_quit(); - break; - case MENU_OP_MAXIMIZE: - case MENU_OP_UNMAXIMIZE: - if (c) - { - clientToggleMaximized(c, WIN_STATE_MAXIMIZED); - } - break; - case MENU_OP_MINIMIZE: - if (c) - { - clientHide(c, True); - } - break; - case MENU_OP_MINIMIZE_ALL: - clientHideAll(c); - break; - case MENU_OP_UNMINIMIZE: - if (c) - { - clientShow(c, True); - } - break; - case MENU_OP_SHADE: - case MENU_OP_UNSHADE: - if (c) - { - clientToggleShaded(c); - } - break; - case MENU_OP_STICK: - case MENU_OP_UNSTICK: - if (c) - { - clientToggleSticky(c); - frameDraw(c); - } - break; - case MENU_OP_DELETE: - if (c) - { - clientClose(c); - frameDraw(c); - } - break; - case MENU_OP_DESTROY: - if (c) - { - clientKill(c); - frameDraw(c); - } - break; - default: - if (c) - { - frameDraw(c); - } - break; - } - menu_free (menu); + case MENU_OP_QUIT: + gtk_main_quit(); + break; + case MENU_OP_MAXIMIZE: + case MENU_OP_UNMAXIMIZE: + if(c) + { + clientToggleMaximized(c, WIN_STATE_MAXIMIZED); + } + break; + case MENU_OP_MINIMIZE: + if(c) + { + clientHide(c, True); + } + break; + case MENU_OP_MINIMIZE_ALL: + clientHideAll(c); + break; + case MENU_OP_UNMINIMIZE: + if(c) + { + clientShow(c, True); + } + break; + case MENU_OP_SHADE: + case MENU_OP_UNSHADE: + if(c) + { + clientToggleShaded(c); + } + break; + case MENU_OP_STICK: + case MENU_OP_UNSTICK: + if(c) + { + clientToggleSticky(c); + frameDraw(c); + } + break; + case MENU_OP_DELETE: + if(c) + { + clientClose(c); + frameDraw(c); + } + break; + case MENU_OP_DESTROY: + if(c) + { + clientKill(c); + frameDraw(c); + } + break; + default: + if(c) + { + frameDraw(c); + } + break; + } + menu_free(menu); } -static gboolean show_popup_cb (GtkWidget *widget, GdkEventButton *ev, gpointer data) +static gboolean show_popup_cb(GtkWidget * widget, GdkEventButton * ev, gpointer data) { - Menu *menu; - MenuOp ops; - MenuOp insensitive; - Client *c = NULL; - gint x = ev->x_root; - gint y = ev->y_root; - - DBG("entering show_popup_cb\n"); - - if (((ev->button == 1) || (ev->button == 3)) && (c = (Client *) data)) - { - c->button_pressed[MENU_BUTTON] = True; - frameDraw(c); - y = c->y; - ops = MENU_OP_DELETE | MENU_OP_DESTROY | MENU_OP_MINIMIZE_ALL; - insensitive = 0; - - if (c->win_state & (WIN_STATE_MAXIMIZED | WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT)) - { - ops |= MENU_OP_UNMAXIMIZE; - } - else - { - ops |= MENU_OP_MAXIMIZE; - } - - if (getWMState(dpy, c->window) == IconicState) - { - ops |= MENU_OP_UNMINIMIZE; - } - else - { - ops |= MENU_OP_MINIMIZE; - } - - if (c->win_state & WIN_STATE_SHADED) - { - ops |= MENU_OP_UNSHADE; - } - else - { - ops |= MENU_OP_SHADE; - } - - if (c->sticky) - { - ops |= MENU_OP_UNSTICK; - } - else - { - ops |= MENU_OP_STICK; - } - } - else - { - return (TRUE); - } - - if (button_handler_id) - { - g_signal_handler_disconnect (GTK_OBJECT (getDefaultGtkWidget()), button_handler_id); - } - button_handler_id = g_signal_connect (GTK_OBJECT (getDefaultGtkWidget()), "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) NULL); - - menu = menu_default (ops, insensitive, menu_callback, c); - menu_popup (menu, x, y, ev->button, ev->time); - return (TRUE); + Menu *menu; + MenuOp ops; + MenuOp insensitive; + Client *c = NULL; + gint x = ev->x_root; + gint y = ev->y_root; + + DBG("entering show_popup_cb\n"); + + if(((ev->button == 1) || (ev->button == 3)) && (c = (Client *) data)) + { + c->button_pressed[MENU_BUTTON] = True; + frameDraw(c); + y = c->y; + ops = MENU_OP_DELETE | MENU_OP_DESTROY | MENU_OP_MINIMIZE_ALL; + insensitive = 0; + + if(c->win_state & (WIN_STATE_MAXIMIZED | WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT)) + { + ops |= MENU_OP_UNMAXIMIZE; + } + else + { + ops |= MENU_OP_MAXIMIZE; + } + + if(getWMState(dpy, c->window) == IconicState) + { + ops |= MENU_OP_UNMINIMIZE; + } + else + { + ops |= MENU_OP_MINIMIZE; + } + + if(c->win_state & WIN_STATE_SHADED) + { + ops |= MENU_OP_UNSHADE; + } + else + { + ops |= MENU_OP_SHADE; + } + + if(c->sticky) + { + ops |= MENU_OP_UNSTICK; + } + else + { + ops |= MENU_OP_STICK; + } + } + else + { + return (TRUE); + } + + if(button_handler_id) + { + g_signal_handler_disconnect(GTK_OBJECT(getDefaultGtkWidget()), button_handler_id); + } + button_handler_id = g_signal_connect(GTK_OBJECT(getDefaultGtkWidget()), "button_press_event", GTK_SIGNAL_FUNC(show_popup_cb), (gpointer) NULL); + + menu = menu_default(ops, insensitive, menu_callback, c); + menu_popup(menu, x, y, ev->button, ev->time); + return (TRUE); } -static gboolean client_event_cb (GtkWidget *widget, GdkEventClient *ev) +static gboolean client_event_cb(GtkWidget * widget, GdkEventClient * ev) { - DBG("entering client_event_cb\n"); - - if (!atom_rcfiles) - { - atom_rcfiles = gdk_atom_intern ("_GTK_READ_RCFILES", FALSE); - } - - if(ev->message_type == atom_rcfiles) - { + DBG("entering client_event_cb\n"); + + if(!atom_rcfiles) + { + atom_rcfiles = gdk_atom_intern("_GTK_READ_RCFILES", FALSE); + } + + if(ev->message_type == atom_rcfiles) + { DBG("setting reload flag so all prefs will be reread at next event loop\n"); reload = True; - } - - return (FALSE); + } + + return (FALSE); } -void initGtkCallbacks (void) +void initGtkCallbacks(void) { - button_handler_id = g_signal_connect (GTK_OBJECT (getDefaultGtkWidget()), "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) NULL); - g_signal_connect (GTK_OBJECT (getDefaultGtkWidget()), "client_event", GTK_SIGNAL_FUNC (client_event_cb), (gpointer) NULL); + button_handler_id = g_signal_connect(GTK_OBJECT(getDefaultGtkWidget()), "button_press_event", GTK_SIGNAL_FUNC(show_popup_cb), (gpointer) NULL); + g_signal_connect(GTK_OBJECT(getDefaultGtkWidget()), "client_event", GTK_SIGNAL_FUNC(client_event_cb), (gpointer) NULL); } diff --git a/src/events.h b/src/events.h index e02d9b95f..6cb85efd7 100644 --- a/src/events.h +++ b/src/events.h @@ -33,7 +33,7 @@ #include <glib.h> void handleEvent(XEvent *); -GtkToXEventFilterStatus xfwm4_event_filter(XEvent *xevent, gpointer data); -void initGtkCallbacks (void); +GtkToXEventFilterStatus xfwm4_event_filter(XEvent * xevent, gpointer data); +void initGtkCallbacks(void); #endif /* __EVENTS_H__ */ diff --git a/src/frame.c b/src/frame.c index be0a39ea1..8a3bcce4d 100644 --- a/src/frame.c +++ b/src/frame.c @@ -184,20 +184,20 @@ static void frameCreateTitlePixmap(Client * c, int state, int left, int right, M w2 = title[TITLE_2][ACTIVE].width; w4 = title[TITLE_4][ACTIVE].width; - - layout = gtk_widget_create_pango_layout (getDefaultGtkWidget (), c->name); - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); - + + layout = gtk_widget_create_pango_layout(getDefaultGtkWidget(), c->name); + pango_layout_get_pixel_extents(layout, NULL, &logical_rect); + if(full_width_title) { w1 = left; w5 = width - right; w3 = width - w1 - w2 - w4 - w5; if(w3 < 0) - { + { w3 = 0; } - switch (title_alignment) + switch (title_alignment) { case ALIGN_RIGHT: tp = w3 - logical_rect.width; @@ -207,22 +207,22 @@ static void frameCreateTitlePixmap(Client * c, int state, int left, int right, M break; } if(tp < 0) - { + { tp = 0; - } + } } else { w3 = logical_rect.width; w5 = width; if(w3 > width - w2 - w4) - { + { w3 = width - w2 - w4; - } + } if(w3 < 0) - { + { w3 = 0; - } + } switch (title_alignment) { case ALIGN_LEFT: @@ -236,33 +236,33 @@ static void frameCreateTitlePixmap(Client * c, int state, int left, int right, M break; } if(w1 < left) - { + { w1 = left; - } + } } - createPixmap (dpy, pm, width, frameTop(c)); - gpixmap = gdk_pixmap_foreign_new (pm->pixmap); + createPixmap(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); - gdk_gc_get_values (title_colors[state].gc, &values); - gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND); - + gdk_gc_get_values(title_colors[state].gc, &values); + gdk_gc_set_values(gc, &values, GDK_GC_FOREGROUND); + if(w1 > 0) { fillRectangle(dpy, pm->pixmap, title[TITLE_1][state].pixmap, 0, 0, w1, frameTop(c)); - fillRectangle(dpy, pm->mask, title[TITLE_1][state].mask, 0, 0, w1, frameTop(c)); + fillRectangle(dpy, pm->mask, title[TITLE_1][state].mask, 0, 0, w1, frameTop(c)); x = x + w1; } fillRectangle(dpy, pm->pixmap, title[TITLE_2][state].pixmap, x, 0, w2, frameTop(c)); - fillRectangle(dpy, pm->mask, title[TITLE_2][state].mask, x, 0, w2, frameTop(c)); + fillRectangle(dpy, pm->mask, title[TITLE_2][state].mask, x, 0, w2, frameTop(c)); x = x + w2; if(w3 > 0) { fillRectangle(dpy, pm->pixmap, title[TITLE_3][state].pixmap, x, 0, w3, frameTop(c)); - fillRectangle(dpy, pm->mask, title[TITLE_3][state].mask, x, 0, w3, frameTop(c)); + fillRectangle(dpy, pm->mask, title[TITLE_3][state].mask, x, 0, w3, frameTop(c)); gdk_draw_layout(gpixmap, gc, x + tp, (frameTop(c) + title_vertical_offset - logical_rect.height) / 2, layout); x = x + w3; } @@ -272,17 +272,17 @@ static void frameCreateTitlePixmap(Client * c, int state, int left, int right, M x = right - w4; } fillRectangle(dpy, pm->pixmap, title[TITLE_4][state].pixmap, x, 0, w4, frameTop(c)); - fillRectangle(dpy, pm->mask, title[TITLE_4][state].mask, x, 0, w4, frameTop(c)); + fillRectangle(dpy, pm->mask, title[TITLE_4][state].mask, x, 0, w4, frameTop(c)); x = x + w4; if(w5 > 0) { fillRectangle(dpy, pm->pixmap, title[TITLE_5][state].pixmap, x, 0, w5, frameTop(c)); - fillRectangle(dpy, pm->mask, title[TITLE_5][state].mask, x, 0, w5, frameTop(c)); + fillRectangle(dpy, pm->mask, title[TITLE_5][state].mask, x, 0, w5, frameTop(c)); } - g_object_unref (G_OBJECT (gc)); - g_object_unref (G_OBJECT (gpixmap)); - g_object_unref (G_OBJECT (layout)); + g_object_unref(G_OBJECT(gc)); + g_object_unref(G_OBJECT(gpixmap)); + g_object_unref(G_OBJECT(layout)); } static int getButtonFromLetter(char c) @@ -362,7 +362,7 @@ static void frameSetShape(Client * c, int state, MyPixmap * title, MyPixmap pm_s { return; } - + temp = XCreateSimpleWindow(dpy, root, 0, 0, frameWidth(c), frameHeight(c), 0, 0, 0); if(c->shaded) @@ -381,23 +381,23 @@ static void frameSetShape(Client * c, int state, MyPixmap * title, MyPixmap pm_s { XShapeCombineMask(dpy, c->title, ShapeBounding, 0, 0, title->mask, ShapeSet); for(i = 0; i < 3; i++) - { + { XShapeCombineMask(dpy, c->sides[i], ShapeBounding, 0, 0, pm_sides[i].mask, ShapeSet); - } + } for(i = 0; i < 4; i++) { - XShapeCombineMask(dpy, c->corners[i], ShapeBounding, 0, 0, corners[i][state].mask, ShapeSet); + XShapeCombineMask(dpy, c->corners[i], ShapeBounding, 0, 0, corners[i][state].mask, ShapeSet); } - for(i = 0; i < BUTTON_COUNT; i++) + for(i = 0; i < BUTTON_COUNT; i++) { if(c->button_pressed[i]) - { + { XShapeCombineMask(dpy, c->buttons[i], ShapeBounding, 0, 0, buttons[i][PRESSED].mask, ShapeSet); } - else + else { - XShapeCombineMask(dpy, c->buttons[i], ShapeBounding, 0, 0, buttons[i][state].mask, ShapeSet); - } + XShapeCombineMask(dpy, c->buttons[i], ShapeBounding, 0, 0, buttons[i][state].mask, ShapeSet); + } } if(corners[CORNER_TOP_LEFT][ACTIVE].height > frameHeight(c) - frameBottom(c) + 1) @@ -442,12 +442,12 @@ static void frameSetShape(Client * c, int state, MyPixmap * title, MyPixmap pm_s XShapeCombineShape(dpy, temp, ShapeBounding, 0, 0, c->corners[CORNER_TOP_LEFT], ShapeBounding, ShapeUnion); XShapeCombineShape(dpy, temp, ShapeBounding, frameWidth(c) - corners[CORNER_TOP_RIGHT][ACTIVE].width, 0, c->corners[CORNER_TOP_RIGHT], ShapeBounding, ShapeUnion); for(i = 0; i < BUTTON_COUNT; i++) - { + { if(strchr(button_layout, getLetterFromButton(i))) - { + { XShapeCombineShape(dpy, temp, ShapeBounding, button_x[i], (frameTop(c) - buttons[i][ACTIVE].height) / 2, c->buttons[i], ShapeBounding, ShapeUnion); - } - } + } + } } XShapeCombineShape(dpy, c->frame, ShapeBounding, 0, 0, temp, ShapeBounding, ShapeSet); XDestroyWindow(dpy, temp); @@ -480,23 +480,23 @@ void frameDraw(Client * c) { XMapWindow(dpy, c->title); for(i = 0; i < 3; i++) - { + { XMapWindow(dpy, c->sides[i]); } - for(i = 0; i < 4; i++) + for(i = 0; i < 4; i++) { - XMapWindow(dpy, c->corners[i]); + XMapWindow(dpy, c->corners[i]); } - for(i = 0; i < BUTTON_COUNT; i++) + for(i = 0; i < BUTTON_COUNT; i++) { if(strchr(button_layout, getLetterFromButton(i))) - { + { XMapWindow(dpy, c->buttons[i]); } - else - { + else + { XUnmapWindow(dpy, c->buttons[i]); - } + } } x = frameLeft(c) + button_offset; @@ -510,9 +510,9 @@ void frameDraw(Client * c) x = x + buttons[button][ACTIVE].width + button_spacing; } else - { + { break; - } + } } left = x - button_spacing; @@ -527,30 +527,30 @@ void frameDraw(Client * c) button_x[button] = x; } else - { + { break; } - } + } right = x; - top_width = frameWidth(c) - corners[CORNER_TOP_LEFT][ACTIVE].width - corners[CORNER_TOP_RIGHT][ACTIVE].width; + top_width = frameWidth(c) - corners[CORNER_TOP_LEFT][ACTIVE].width - corners[CORNER_TOP_RIGHT][ACTIVE].width; bottom_width = frameWidth(c) - corners[CORNER_BOTTOM_LEFT][ACTIVE].width - corners[CORNER_BOTTOM_RIGHT][ACTIVE].width; - left_height = frameHeight(c) - frameTop(c) - corners[CORNER_BOTTOM_LEFT][ACTIVE].height; + left_height = frameHeight(c) - frameTop(c) - corners[CORNER_BOTTOM_LEFT][ACTIVE].height; right_height = frameHeight(c) - frameTop(c) - corners[CORNER_BOTTOM_RIGHT][ACTIVE].height; frameCreateTitlePixmap(c, state, left, right, &pm_title); - createPixmap (dpy, &pm_sides[SIDE_LEFT], frameLeft(c), left_height); + createPixmap(dpy, &pm_sides[SIDE_LEFT], frameLeft(c), left_height); fillRectangle(dpy, pm_sides[SIDE_LEFT].pixmap, sides[SIDE_LEFT][state].pixmap, 0, 0, frameLeft(c), left_height); - fillRectangle(dpy, pm_sides[SIDE_LEFT].mask, sides[SIDE_LEFT][state].mask, 0, 0, frameLeft(c), left_height); + fillRectangle(dpy, pm_sides[SIDE_LEFT].mask, sides[SIDE_LEFT][state].mask, 0, 0, frameLeft(c), left_height); - createPixmap (dpy, &pm_sides[SIDE_RIGHT], frameRight(c), right_height); + createPixmap(dpy, &pm_sides[SIDE_RIGHT], frameRight(c), right_height); fillRectangle(dpy, pm_sides[SIDE_RIGHT].pixmap, sides[SIDE_RIGHT][state].pixmap, 0, 0, frameRight(c), right_height); - fillRectangle(dpy, pm_sides[SIDE_RIGHT].mask, sides[SIDE_RIGHT][state].mask, 0, 0, frameRight(c), right_height); + fillRectangle(dpy, pm_sides[SIDE_RIGHT].mask, sides[SIDE_RIGHT][state].mask, 0, 0, frameRight(c), right_height); - createPixmap (dpy, &pm_sides[SIDE_BOTTOM], bottom_width, frameBottom(c)); + createPixmap(dpy, &pm_sides[SIDE_BOTTOM], bottom_width, frameBottom(c)); fillRectangle(dpy, pm_sides[SIDE_BOTTOM].pixmap, sides[SIDE_BOTTOM][state].pixmap, 0, 0, bottom_width, frameBottom(c)); - fillRectangle(dpy, pm_sides[SIDE_BOTTOM].mask, sides[SIDE_BOTTOM][state].mask, 0, 0, bottom_width, frameBottom(c)); + fillRectangle(dpy, pm_sides[SIDE_BOTTOM].mask, sides[SIDE_BOTTOM][state].mask, 0, 0, bottom_width, frameBottom(c)); XSetWindowBackgroundPixmap(dpy, c->title, pm_title.pixmap); XSetWindowBackgroundPixmap(dpy, c->sides[SIDE_LEFT], pm_sides[SIDE_LEFT].pixmap); @@ -560,17 +560,17 @@ void frameDraw(Client * c) XSetWindowBackgroundPixmap(dpy, c->corners[CORNER_TOP_RIGHT], corners[CORNER_TOP_RIGHT][state].pixmap); XSetWindowBackgroundPixmap(dpy, c->corners[CORNER_BOTTOM_LEFT], corners[CORNER_BOTTOM_LEFT][state].pixmap); XSetWindowBackgroundPixmap(dpy, c->corners[CORNER_BOTTOM_RIGHT], corners[CORNER_BOTTOM_RIGHT][state].pixmap); - + for(i = 0; i < BUTTON_COUNT; i++) { if(c->button_pressed[i]) - { + { XSetWindowBackgroundPixmap(dpy, c->buttons[i], buttons[i][PRESSED].pixmap); } - else - { + else + { XSetWindowBackgroundPixmap(dpy, c->buttons[i], buttons[i][state].pixmap); - } + } } XMoveResizeWindow(dpy, c->title, corners[CORNER_TOP_LEFT][ACTIVE].width, 0, top_width < 1 ? 1 : top_width, frameTop(c)); @@ -584,39 +584,39 @@ void frameDraw(Client * c) XMoveResizeWindow(dpy, c->corners[CORNER_BOTTOM_RIGHT], frameWidth(c) - corners[CORNER_BOTTOM_RIGHT][ACTIVE].width, frameHeight(c) - corners[CORNER_BOTTOM_RIGHT][ACTIVE].height, corners[CORNER_BOTTOM_RIGHT][ACTIVE].width, corners[CORNER_BOTTOM_RIGHT][ACTIVE].height); XClearWindow(dpy, c->title); - XClearWindow(dpy, c->sides[SIDE_LEFT]); - XClearWindow(dpy, c->sides[SIDE_RIGHT]); + XClearWindow(dpy, c->sides[SIDE_LEFT]); + XClearWindow(dpy, c->sides[SIDE_RIGHT]); XClearWindow(dpy, c->sides[SIDE_BOTTOM]); - XClearWindow(dpy, c->corners[CORNER_TOP_LEFT]); - XClearWindow(dpy, c->corners[CORNER_TOP_RIGHT]); - XClearWindow(dpy, c->corners[CORNER_BOTTOM_LEFT]); - XClearWindow(dpy, c->corners[CORNER_BOTTOM_RIGHT]); + XClearWindow(dpy, c->corners[CORNER_TOP_LEFT]); + XClearWindow(dpy, c->corners[CORNER_TOP_RIGHT]); + XClearWindow(dpy, c->corners[CORNER_BOTTOM_LEFT]); + XClearWindow(dpy, c->corners[CORNER_BOTTOM_RIGHT]); - for(i = 0; i < BUTTON_COUNT; i++) + for(i = 0; i < BUTTON_COUNT; i++) { - XClearWindow(dpy, c->buttons[i]); + XClearWindow(dpy, c->buttons[i]); } - frameSetShape(c, state, &pm_title, pm_sides, button_x); + frameSetShape(c, state, &pm_title, pm_sides, button_x); freePixmap(dpy, &pm_title); - freePixmap(dpy, &pm_sides[SIDE_LEFT]); - freePixmap(dpy, &pm_sides[SIDE_RIGHT]); - freePixmap(dpy, &pm_sides[SIDE_BOTTOM]); + freePixmap(dpy, &pm_sides[SIDE_LEFT]); + freePixmap(dpy, &pm_sides[SIDE_RIGHT]); + freePixmap(dpy, &pm_sides[SIDE_BOTTOM]); } else { XUnmapWindow(dpy, c->title); for(i = 0; i < 3; i++) - { + { XUnmapWindow(dpy, c->sides[i]); } - for(i = 0; i < 4; i++) - { + for(i = 0; i < 4; i++) + { XUnmapWindow(dpy, c->corners[i]); } for(i = 0; i < BUTTON_COUNT; i++) - { + { XUnmapWindow(dpy, c->buttons[i]); } frameSetShape(c, 0, NULL, NULL, NULL); diff --git a/src/gtk_style.c b/src/gtk_style.c index f4241e7af..681f0cbcf 100644 --- a/src/gtk_style.c +++ b/src/gtk_style.c @@ -47,178 +47,178 @@ char *names[] = { #define GTKSTYLE_DARK 5 #define GTKSTYLE_MID 6 -static gint state_value (gchar *s) +static gint state_value(gchar * s) { gchar *t; - gint u; - + gint u; + t = states[0]; u = 0; - - while ((states[u]) && (strcmp (states[u], s))) + + while((states[u]) && (strcmp(states[u], s))) { u++; } - if (states[u]) + if(states[u]) { return (u); } return (0); } -static gint name_value (gchar *s) +static gint name_value(gchar * s) { gchar *t; - gint u; - + gint u; + t = names[0]; u = 0; - - while ((names[u]) && (strcmp (names[u], s))) + + while((names[u]) && (strcmp(names[u], s))) { u++; } - if (names[u]) + if(names[u]) { return (u); } return (0); } -static gchar *print_color (GdkColor *c) +static gchar *print_color(GdkColor * c) { gchar *s; - - s = g_new (gchar, 8); - g_snprintf (s, 8, "#%02x%02x%02x", c->red / 256, c->green / 256, c->blue / 256); + + s = g_new(gchar, 8); + g_snprintf(s, 8, "#%02x%02x%02x", c->red / 256, c->green / 256, c->blue / 256); return (s); } -static gchar *print_colors (GdkColor *x, int n) +static gchar *print_colors(GdkColor * x, int n) { - return (print_color (x + n)); + return (print_color(x + n)); } -static gchar *print_rc_style (gchar *name, gchar *state, GtkStyle *style) +static gchar *print_rc_style(gchar * name, gchar * state, GtkStyle * style) { gchar *s; gint n, m; - g_return_val_if_fail (state != NULL, NULL); - g_return_val_if_fail (name != NULL, NULL); - - n = state_value (state); - m = name_value (name); - + g_return_val_if_fail(state != NULL, NULL); + g_return_val_if_fail(name != NULL, NULL); + + n = state_value(state); + m = name_value(name); + switch (m) { case GTKSTYLE_FG: - s = print_colors (style->fg, n); - break; + s = print_colors(style->fg, n); + break; case GTKSTYLE_BG: - s = print_colors (style->bg, n); - break; + s = print_colors(style->bg, n); + break; case GTKSTYLE_TEXT: - s = print_colors (style->text, n); - break; + s = print_colors(style->text, n); + break; case GTKSTYLE_BASE: - s = print_colors (style->base, n); - break; + s = print_colors(style->base, n); + break; case GTKSTYLE_LIGHT: - s = print_colors (style->light, n); - break; + s = print_colors(style->light, n); + break; case GTKSTYLE_DARK: - s = print_colors (style->dark, n); - break; - default: + s = print_colors(style->dark, n); + break; + default: case GTKSTYLE_MID: - s = print_colors (style->mid, n); - break; + s = print_colors(style->mid, n); + break; } return (s); } -gchar *get_style (GtkWidget *win, gchar *name, gchar *state) +gchar *get_style(GtkWidget * win, gchar * name, gchar * state) { GtkStyle *style = NULL; gchar *s = NULL; DBG("entering get_style\n"); - g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL); + g_return_val_if_fail(GTK_WIDGET_REALIZED(win), NULL); - style = gtk_rc_get_style (win); - if (!style) + style = gtk_rc_get_style(win); + if(!style) { - style = gtk_widget_get_style (win); + style = gtk_widget_get_style(win); } - s = print_rc_style (name, state, style); + s = print_rc_style(name, state, style); DBG("%s[%s]=%s\n", name, state, s); return (s); } -static GdkGC *_get_style_gc (gchar *name, gchar *state, GtkStyle *style) +static GdkGC *_get_style_gc(gchar * name, gchar * state, GtkStyle * style) { GdkGC *gc = NULL; gint n, m; - g_return_val_if_fail (state != NULL, NULL); - g_return_val_if_fail (name != NULL, NULL); - - n = state_value (state); - m = name_value (name); - + g_return_val_if_fail(state != NULL, NULL); + g_return_val_if_fail(name != NULL, NULL); + + n = state_value(state); + m = name_value(name); + switch (m) { case GTKSTYLE_FG: - gc = style->fg_gc[n]; - break; + gc = style->fg_gc[n]; + break; case GTKSTYLE_BG: - gc = style->bg_gc[n]; - break; + gc = style->bg_gc[n]; + break; case GTKSTYLE_TEXT: - gc = style->text_gc[n]; - break; + gc = style->text_gc[n]; + break; case GTKSTYLE_BASE: - gc = style->base_gc[n]; - break; + gc = style->base_gc[n]; + break; case GTKSTYLE_LIGHT: - gc = style->light_gc[n]; - break; + gc = style->light_gc[n]; + break; case GTKSTYLE_DARK: - gc = style->dark_gc[n]; - break; - default: + gc = style->dark_gc[n]; + break; + default: case GTKSTYLE_MID: - gc = style->mid_gc[n]; - break; + gc = style->mid_gc[n]; + break; } return (gc); } -GdkGC *get_style_gc (GtkWidget *win, gchar *name, gchar *state) +GdkGC *get_style_gc(GtkWidget * win, gchar * name, gchar * state) { GtkStyle *style = NULL; DBG("entering get_style_gc\n"); - g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL); + g_return_val_if_fail(GTK_WIDGET_REALIZED(win), NULL); - style = gtk_rc_get_style (win); - if (!style) + style = gtk_rc_get_style(win); + if(!style) { - style = gtk_widget_get_style (win); + style = gtk_widget_get_style(win); } return (_get_style_gc(name, state, style)); } -PangoFontDescription *get_font_desc (GtkWidget *win) +PangoFontDescription *get_font_desc(GtkWidget * win) { DBG("entering get_font_desc\n"); - g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL); + g_return_val_if_fail(GTK_WIDGET_REALIZED(win), NULL); return (win->style->font_desc); } -PangoContext *pango_get_context (GtkWidget *win) +PangoContext *pango_get_context(GtkWidget * win) { DBG("entering pango_get_context\n"); - g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL); - return (gtk_widget_get_pango_context (win)); + g_return_val_if_fail(GTK_WIDGET_REALIZED(win), NULL); + return (gtk_widget_get_pango_context(win)); } diff --git a/src/gtk_style.h b/src/gtk_style.h index 8b1fa65ab..45306a216 100644 --- a/src/gtk_style.h +++ b/src/gtk_style.h @@ -29,9 +29,9 @@ #include <gtk/gtk.h> #include <pango/pango-font.h> -gchar *get_style (GtkWidget *, gchar *, gchar *); -GdkGC *get_style_gc (GtkWidget *, gchar *, gchar *); -PangoFontDescription *get_font_desc (GtkWidget *); -PangoContext *pango_get_context (GtkWidget *); +gchar *get_style(GtkWidget *, gchar *, gchar *); +GdkGC *get_style_gc(GtkWidget *, gchar *, gchar *); +PangoFontDescription *get_font_desc(GtkWidget *); +PangoContext *pango_get_context(GtkWidget *); #endif diff --git a/src/gtktoxevent.c b/src/gtktoxevent.c index bb0ea6547..1eb42b418 100644 --- a/src/gtktoxevent.c +++ b/src/gtktoxevent.c @@ -33,227 +33,226 @@ static GtkToXEventFilterStack *filterstack = NULL; static GtkWidget *gtk_win = NULL; static GdkWindow *event_win = NULL; -static GtkToXEventFilterStatus default_event_filter(XEvent *xevent, gpointer data) +static GtkToXEventFilterStatus default_event_filter(XEvent * xevent, gpointer data) { - switch (xevent->type) - { - case KeyPress: - DBG("Unhandled KeyPress event"); - break; - case KeyRelease: - DBG("Unhandled KeyRelease event"); - break; - case ButtonPress: - DBG("Unhandled ButtonPress event"); - break; - case ButtonRelease: - DBG("Unhandled ButtonRelease event"); - break; - case MotionNotify: - DBG("Unhandled MotionNotify event"); - break; - case EnterNotify: - DBG("Unhandled EnterNotify event"); - break; - case LeaveNotify: - DBG("Unhandled LeaveNotify event"); - break; - case FocusIn: - DBG("Unhandled FocusIn event"); - break; - case FocusOut: - DBG("Unhandled FocusOut event"); - break; - case KeymapNotify: - DBG("Unhandled KeymapNotify event"); - break; - case Expose: - DBG("Unhandled Expose event"); - break; - case GraphicsExpose: - DBG("Unhandled GraphicsExpose event"); - break; - case NoExpose: - DBG("Unhandled NoExpose event"); - break; - case VisibilityNotify: - DBG("Unhandled VisibilityNotify event"); - break; - case DestroyNotify: - DBG("Unhandled DestroyNotify event"); - break; - case UnmapNotify: - DBG("Unhandled UnmapNotify event"); - break; - case MapNotify: - DBG("Unhandled MapNotify event"); - break; - case MapRequest: - DBG("Unhandled MapRequest event"); - break; - case ReparentNotify: - DBG("Unhandled ReparentNotify event"); - break; - case ConfigureNotify: - DBG("Unhandled ConfigureNotify event"); - break; - case ConfigureRequest: - DBG("Unhandled ConfigureRequest event"); - break; - case GravityNotify: - DBG("Unhandled GravityNotify event"); - break; - case ResizeRequest: - DBG("Unhandled ResizeRequest event"); - break; - case CirculateNotify: - DBG("Unhandled CirculateNotify event"); - break; - case CirculateRequest: - DBG("Unhandled CirculateRequest event"); - break; - case PropertyNotify: - DBG("Unhandled PropertyNotify event"); - break; - case SelectionClear: - DBG("Unhandled SelectionClear event"); - break; - case SelectionRequest: - DBG("Unhandled SelectionRequest event"); - break; - case SelectionNotify: - DBG("Unhandled SelectionNotify event"); - break; - case ColormapNotify: - DBG("Unhandled ColormapNotify event"); - break; - case MappingNotify: - DBG("Unhandled MappingNotify event"); - break; - default: - DBG("Unhandled Unknown event"); - break; - } - /* This is supposed to be the default fallback event handler, so we return XEV_FILTER_STOP since we have "treated" the event */ - return XEV_FILTER_STOP; + switch (xevent->type) + { + case KeyPress: + DBG("Unhandled KeyPress event"); + break; + case KeyRelease: + DBG("Unhandled KeyRelease event"); + break; + case ButtonPress: + DBG("Unhandled ButtonPress event"); + break; + case ButtonRelease: + DBG("Unhandled ButtonRelease event"); + break; + case MotionNotify: + DBG("Unhandled MotionNotify event"); + break; + case EnterNotify: + DBG("Unhandled EnterNotify event"); + break; + case LeaveNotify: + DBG("Unhandled LeaveNotify event"); + break; + case FocusIn: + DBG("Unhandled FocusIn event"); + break; + case FocusOut: + DBG("Unhandled FocusOut event"); + break; + case KeymapNotify: + DBG("Unhandled KeymapNotify event"); + break; + case Expose: + DBG("Unhandled Expose event"); + break; + case GraphicsExpose: + DBG("Unhandled GraphicsExpose event"); + break; + case NoExpose: + DBG("Unhandled NoExpose event"); + break; + case VisibilityNotify: + DBG("Unhandled VisibilityNotify event"); + break; + case DestroyNotify: + DBG("Unhandled DestroyNotify event"); + break; + case UnmapNotify: + DBG("Unhandled UnmapNotify event"); + break; + case MapNotify: + DBG("Unhandled MapNotify event"); + break; + case MapRequest: + DBG("Unhandled MapRequest event"); + break; + case ReparentNotify: + DBG("Unhandled ReparentNotify event"); + break; + case ConfigureNotify: + DBG("Unhandled ConfigureNotify event"); + break; + case ConfigureRequest: + DBG("Unhandled ConfigureRequest event"); + break; + case GravityNotify: + DBG("Unhandled GravityNotify event"); + break; + case ResizeRequest: + DBG("Unhandled ResizeRequest event"); + break; + case CirculateNotify: + DBG("Unhandled CirculateNotify event"); + break; + case CirculateRequest: + DBG("Unhandled CirculateRequest event"); + break; + case PropertyNotify: + DBG("Unhandled PropertyNotify event"); + break; + case SelectionClear: + DBG("Unhandled SelectionClear event"); + break; + case SelectionRequest: + DBG("Unhandled SelectionRequest event"); + break; + case SelectionNotify: + DBG("Unhandled SelectionNotify event"); + break; + case ColormapNotify: + DBG("Unhandled ColormapNotify event"); + break; + case MappingNotify: + DBG("Unhandled MappingNotify event"); + break; + default: + DBG("Unhandled Unknown event"); + break; + } + /* This is supposed to be the default fallback event handler, so we return XEV_FILTER_STOP since we have "treated" the event */ + return XEV_FILTER_STOP; } -static GdkFilterReturn gdkXEventFilter(GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data) +static GdkFilterReturn gdkXEventFilter(GdkXEvent * gdk_xevent, GdkEvent * event, gpointer data) { - XEvent *xevent = (XEvent*)gdk_xevent; - GtkToXEventFilterStatus loop = XEV_FILTER_CONTINUE; - GtkToXEventFilterStack *filterelt = filterstack; - - g_return_val_if_fail (filterelt != NULL, GDK_FILTER_CONTINUE); - - while ((filterelt) && (loop == XEV_FILTER_CONTINUE)) - { - loop = (*filterelt->filter) (xevent, filterelt->data); - filterelt = filterelt->next; - } - return GDK_FILTER_CONTINUE; + XEvent *xevent = (XEvent *) gdk_xevent; + GtkToXEventFilterStatus loop = XEV_FILTER_CONTINUE; + GtkToXEventFilterStack *filterelt = filterstack; + + g_return_val_if_fail(filterelt != NULL, GDK_FILTER_CONTINUE); + + while((filterelt) && (loop == XEV_FILTER_CONTINUE)) + { + loop = (*filterelt->filter) (xevent, filterelt->data); + filterelt = filterelt->next; + } + return GDK_FILTER_CONTINUE; } GtkToXEventFilterStack *pushEventFilter(GtkToXEventFilter filter, gpointer data) { - g_assert (filter != NULL); - if (filterstack) - { - GtkToXEventFilterStack *newfilterstack = (GtkToXEventFilterStack *) g_new (GtkToXEventFilterStack, 1); - newfilterstack->filter = filter; - newfilterstack->data = data; - newfilterstack->next = filterstack; - filterstack = newfilterstack; - } - else - { - filterstack = (GtkToXEventFilterStack *) g_new (GtkToXEventFilterStack, 1); - filterstack->filter = filter; - filterstack->data = data; - filterstack->next = NULL; - } - return (filterstack); + g_assert(filter != NULL); + if(filterstack) + { + GtkToXEventFilterStack *newfilterstack = (GtkToXEventFilterStack *) g_new(GtkToXEventFilterStack, 1); + newfilterstack->filter = filter; + newfilterstack->data = data; + newfilterstack->next = filterstack; + filterstack = newfilterstack; + } + else + { + filterstack = (GtkToXEventFilterStack *) g_new(GtkToXEventFilterStack, 1); + filterstack->filter = filter; + filterstack->data = data; + filterstack->next = NULL; + } + return (filterstack); } GtkToXEventFilterStack *popEventFilter(void) { - GtkToXEventFilterStack *oldfilterstack = filterstack; - g_return_val_if_fail (filterstack != NULL, NULL); - filterstack = oldfilterstack->next; - g_free (oldfilterstack); - return (filterstack); + GtkToXEventFilterStack *oldfilterstack = filterstack; + g_return_val_if_fail(filterstack != NULL, NULL); + filterstack = oldfilterstack->next; + g_free(oldfilterstack); + return (filterstack); } -GtkToXEventFilterStack *initEventFilter(long event_mask, gpointer data, const gchar *widget_name) +GtkToXEventFilterStack *initEventFilter(long event_mask, gpointer data, const gchar * widget_name) { - XWindowAttributes attribs; + XWindowAttributes attribs; - pushEventFilter (default_event_filter, data); - event_win = gdk_window_foreign_new(GDK_ROOT_WINDOW()); + pushEventFilter(default_event_filter, data); + event_win = gdk_window_foreign_new(GDK_ROOT_WINDOW()); #if ((GTK_MAJOR_VERSION <= 1) && (GTK_MINOR_VERSION <= 2)) - /* This is a hack for gtk 1.2.x */ - gdk_window_add_filter(GDK_ROOT_PARENT(), gdkXEventFilter, NULL); + /* This is a hack for gtk 1.2.x */ + gdk_window_add_filter(GDK_ROOT_PARENT(), gdkXEventFilter, NULL); #endif - gdk_window_add_filter(NULL, gdkXEventFilter, NULL); + gdk_window_add_filter(NULL, gdkXEventFilter, NULL); - gdk_error_trap_push(); - XGetWindowAttributes(GDK_DISPLAY(), GDK_ROOT_WINDOW(), &attribs); - XSelectInput(GDK_DISPLAY(), GDK_ROOT_WINDOW(), attribs.your_event_mask | event_mask); - gdk_flush(); - if (gdk_error_trap_pop()) - { - g_error ("Another Window Manager is already running"); - } - /* Create a GTK window so that we are just like any other GTK application */ - gtk_win = gtk_window_new (GTK_WINDOW_POPUP); + gdk_error_trap_push(); + XGetWindowAttributes(GDK_DISPLAY(), GDK_ROOT_WINDOW(), &attribs); + XSelectInput(GDK_DISPLAY(), GDK_ROOT_WINDOW(), attribs.your_event_mask | event_mask); + gdk_flush(); + if(gdk_error_trap_pop()) + { + g_error("Another Window Manager is already running"); + } + /* Create a GTK window so that we are just like any other GTK application */ + gtk_win = gtk_window_new(GTK_WINDOW_POPUP); #if ((GTK_MAJOR_VERSION <= 1) && (GTK_MINOR_VERSION <= 2)) - gtk_widget_set_usize (gtk_win, 5, 5); - gtk_widget_set_uposition (gtk_win, -1000, -1000); - gtk_widget_set_double_buffered(GTK_WIDGET(gtk_win), FALSE); + gtk_widget_set_usize(gtk_win, 5, 5); + gtk_widget_set_uposition(gtk_win, -1000, -1000); + gtk_widget_set_double_buffered(GTK_WIDGET(gtk_win), FALSE); #else - gtk_window_resize (GTK_WINDOW(gtk_win), 5, 5); - gtk_window_move (GTK_WINDOW(gtk_win), -1000, -1000); + gtk_window_resize(GTK_WINDOW(gtk_win), 5, 5); + gtk_window_move(GTK_WINDOW(gtk_win), -1000, -1000); #endif - if (widget_name) - { - gtk_widget_set_name (gtk_win, widget_name); - } - gtk_widget_show_now (gtk_win); - gdk_window_set_user_data (event_win, gtk_win); - gdk_flush(); - - return (filterstack); + if(widget_name) + { + gtk_widget_set_name(gtk_win, widget_name); + } + gtk_widget_show_now(gtk_win); + gdk_window_set_user_data(event_win, gtk_win); + gdk_flush(); + + return (filterstack); } void closeEventFilter(void) { - GtkToXEventFilterStack *filterelt = filterstack; - while((filterelt = popEventFilter())); - gdk_window_remove_filter(NULL, gdkXEventFilter, NULL); - gdk_window_set_user_data (event_win, NULL); - gtk_widget_destroy(gtk_win); - gdk_flush(); + GtkToXEventFilterStack *filterelt = filterstack; + while((filterelt = popEventFilter())); + gdk_window_remove_filter(NULL, gdkXEventFilter, NULL); + gdk_window_set_user_data(event_win, NULL); + gtk_widget_destroy(gtk_win); + gdk_flush(); } GtkWidget *getDefaultGtkWidget(void) { - return (GTK_WIDGET(gtk_win)); + return (GTK_WIDGET(gtk_win)); } Window getDefaultXWindow(void) { - g_return_val_if_fail (gtk_win != NULL, None); - return (GDK_WINDOW_XWINDOW(gtk_win->window)); + g_return_val_if_fail(gtk_win != NULL, None); + return (GDK_WINDOW_XWINDOW(gtk_win->window)); } GdkWindow *getGdkEventWindow(void) { - return (event_win); + return (event_win); } GdkWindow *getDefaultGdkWindow(void) { - g_return_val_if_fail (gtk_win != NULL, NULL); - return ((GdkWindow *) gtk_win->window); + g_return_val_if_fail(gtk_win != NULL, NULL); + return ((GdkWindow *) gtk_win->window); } - diff --git a/src/gtktoxevent.h b/src/gtktoxevent.h index c2c103d8f..f6773fd67 100644 --- a/src/gtktoxevent.h +++ b/src/gtktoxevent.h @@ -28,24 +28,26 @@ #include <gdk/gdk.h> #include <X11/Xlib.h> -typedef enum +typedef enum { - XEV_FILTER_STOP = TRUE, - XEV_FILTER_CONTINUE = FALSE -} GtkToXEventFilterStatus; + XEV_FILTER_STOP = TRUE, + XEV_FILTER_CONTINUE = FALSE +} +GtkToXEventFilterStatus; -typedef GtkToXEventFilterStatus (*GtkToXEventFilter) (XEvent *xevent, gpointer data); +typedef GtkToXEventFilterStatus(*GtkToXEventFilter) (XEvent * xevent, gpointer data); typedef struct GtkToXEventFilterStack { - GtkToXEventFilter filter; - gpointer data; - struct GtkToXEventFilterStack *next; -} GtkToXEventFilterStack; + GtkToXEventFilter filter; + gpointer data; + struct GtkToXEventFilterStack *next; +} +GtkToXEventFilterStack; GtkToXEventFilterStack *pushEventFilter(GtkToXEventFilter filter, gpointer data); GtkToXEventFilterStack *popEventFilter(void); -GtkToXEventFilterStack *initEventFilter(long event_mask, gpointer data, const gchar *widget_name); +GtkToXEventFilterStack *initEventFilter(long event_mask, gpointer data, const gchar * widget_name); void closeEventFilter(void); GtkWidget *getDefaultGtkWidget(void); Window getDefaultXWindow(void); diff --git a/src/hints.c b/src/hints.c index f6e51cc74..1e783cfd9 100644 --- a/src/hints.c +++ b/src/hints.c @@ -104,15 +104,15 @@ void initICCCMHints(Display * dpy) { DBG("entering initICCCMHints\n"); - wm_state = XInternAtom(dpy, "WM_STATE", False); - wm_change_state = XInternAtom(dpy, "WM_CHANGE_STATE", False); - wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - wm_takefocus = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False); + wm_state = XInternAtom(dpy, "WM_STATE", False); + wm_change_state = XInternAtom(dpy, "WM_CHANGE_STATE", False); + wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False); + wm_takefocus = XInternAtom(dpy, "WM_TAKE_FOCUS", False); + wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False); wm_colormap_windows = XInternAtom(dpy, "WM_COLORMAP_WINDOWS", False); - wm_window_role = XInternAtom(dpy, "WM_WINDOW_ROLE", False); - wm_client_leader = XInternAtom(dpy, "WM_CLIENT_LEADER", False); - sm_client_id = XInternAtom(dpy, "SM_CLIENT_ID", False); + wm_window_role = XInternAtom(dpy, "WM_WINDOW_ROLE", False); + wm_client_leader = XInternAtom(dpy, "WM_CLIENT_LEADER", False); + sm_client_id = XInternAtom(dpy, "SM_CLIENT_ID", False); } unsigned long getWMState(Display * dpy, Window w) @@ -127,7 +127,7 @@ unsigned long getWMState(Display * dpy, Window w) if((XGetWindowProperty(dpy, w, wm_state, 0L, 2L, False, wm_state, &real_type, &real_format, &items_read, &items_left, (unsigned char **)&data) == Success) && (items_read)) { state = *data; - XFree(data); + XFree(data); } return (state); } @@ -170,23 +170,23 @@ PropMwmHints *getMotifHints(Display * dpy, Window w) } } -int getWMInput (Display * dpy, Window w) +int getWMInput(Display * dpy, Window w) { XWMHints *wmhints; int result; - + DBG("entering getWMInput\n"); - wmhints = XGetWMHints (dpy, w); + wmhints = XGetWMHints(dpy, w); result = ((!(wmhints) || ((wmhints) && !(wmhints->flags & InputHint)) || ((wmhints) && (wmhints->flags & InputHint) && (wmhints->input)))); - if (wmhints) + if(wmhints) { - XFree (wmhints); + XFree(wmhints); } return (result); } -int getWMTakeFocus (Display * dpy, Window w) +int getWMTakeFocus(Display * dpy, Window w) { Atom *protocols = None, *ap; int i, n; @@ -197,32 +197,32 @@ int getWMTakeFocus (Display * dpy, Window w) DBG("entering getWMTakeFocus\n"); - if (XGetWMProtocols (dpy, w, &protocols, &n)) + if(XGetWMProtocols(dpy, w, &protocols, &n)) { - for (i = 0, ap = protocols; i < n; i++, ap++) - { - if (*ap == (Atom) wm_takefocus) - { - result = True; - } - } + for(i = 0, ap = protocols; i < n; i++, ap++) + { + if(*ap == (Atom) wm_takefocus) + { + result = True; + } + } } else { - if ((XGetWindowProperty (dpy, w, wm_protocols, 0L, 10L, False, wm_protocols, &atype, &aformat, &nitems, &bytes_remain, (unsigned char **) &protocols)) == Success) - { - for (i = 0, ap = protocols; i < nitems; i++, ap++) - { - if (*ap == (Atom) wm_takefocus) - { - result = True; - } - } - } + if((XGetWindowProperty(dpy, w, wm_protocols, 0L, 10L, False, wm_protocols, &atype, &aformat, &nitems, &bytes_remain, (unsigned char **)&protocols)) == Success) + { + for(i = 0, ap = protocols; i < nitems; i++, ap++) + { + if(*ap == (Atom) wm_takefocus) + { + result = True; + } + } + } } - if (protocols) + if(protocols) { - XFree (protocols); + XFree(protocols); } return (result); } @@ -232,15 +232,15 @@ void initGnomeHints(Display * dpy) { DBG("entering initGnomeHints\n"); - win_hints = XInternAtom(dpy, "_WIN_HINTS", False); - win_state = XInternAtom(dpy, "_WIN_STATE", False); - win_client_list = XInternAtom(dpy, "_WIN_CLIENT_LIST", False); - win_layer = XInternAtom(dpy, "_WIN_LAYER", False); - win_workspace = XInternAtom(dpy, "_WIN_WORKSPACE", False); - win_workspace_count = XInternAtom(dpy, "_WIN_WORKSPACE_COUNT", False); - win_desktop_button_proxy = XInternAtom(dpy, "_WIN_DESKTOP_BUTTON_PROXY", False); - win_supporting_wm_check = XInternAtom(dpy, "_WIN_SUPPORTING_WM_CHECK", False); - gnome_panel_desktop_area = XInternAtom(dpy, "GNOME_PANEL_DESKTOP_AREA", False); + win_hints = XInternAtom(dpy, "_WIN_HINTS", False); + win_state = XInternAtom(dpy, "_WIN_STATE", False); + win_client_list = XInternAtom(dpy, "_WIN_CLIENT_LIST", False); + win_layer = XInternAtom(dpy, "_WIN_LAYER", False); + win_workspace = XInternAtom(dpy, "_WIN_WORKSPACE", False); + win_workspace_count = XInternAtom(dpy, "_WIN_WORKSPACE_COUNT", False); + win_desktop_button_proxy = XInternAtom(dpy, "_WIN_DESKTOP_BUTTON_PROXY", False); + win_supporting_wm_check = XInternAtom(dpy, "_WIN_SUPPORTING_WM_CHECK", False); + gnome_panel_desktop_area = XInternAtom(dpy, "GNOME_PANEL_DESKTOP_AREA", False); } int getGnomeHint(Display * dpy, Window w, Atom a, long *value) @@ -253,11 +253,11 @@ int getGnomeHint(Display * dpy, Window w, Atom a, long *value) DBG("entering getGnomeHint\n"); *value = 0; - - if((XGetWindowProperty (dpy, w, a, 0L, 1L, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, (unsigned char **)&data) == Success) && (items_read)) + + if((XGetWindowProperty(dpy, w, a, 0L, 1L, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, (unsigned char **)&data) == Success) && (items_read)) { *value = *data; - XFree(data); + XFree(data); success = True; } return (success); @@ -279,7 +279,7 @@ void getGnomeDesktopMargins(Display * dpy, CARD32 * margins) DBG("entering getGnomeDesktopMargins\n"); - if((XGetWindowProperty (dpy, XDefaultRootWindow(dpy), gnome_panel_desktop_area, 0L, 4L, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, (unsigned char **)&data) == Success) && (items_read >= 4)) + if((XGetWindowProperty(dpy, XDefaultRootWindow(dpy), gnome_panel_desktop_area, 0L, 4L, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, (unsigned char **)&data) == Success) && (items_read >= 4)) { margins[0] = data[0]; margins[1] = data[1]; @@ -300,43 +300,43 @@ void initNetHints(Display * dpy) { DBG("entering initNetHints\n"); - utf8_string = XInternAtom(dpy, "UTF8_STRING", False); - net_wm_name = XInternAtom(dpy, "_NET_WM_NAME", False); - net_close_window = XInternAtom(dpy, "_NET_CLOSE_WINDOW", False); - net_wm_state = XInternAtom(dpy, "_NET_WM_STATE", False); - net_wm_state_shaded = XInternAtom(dpy, "_NET_WM_STATE_SHADED", False); - net_wm_state_sticky = XInternAtom(dpy, "_NET_WM_STATE_STICKY", False); - net_wm_state_maximized_horz = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_HORZ", False); - net_wm_state_maximized_vert = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_VERT", False); - net_wm_state_fullscreen = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - net_wm_desktop = XInternAtom(dpy, "_NET_WM_DESKTOP", False); - net_number_of_desktops = XInternAtom(dpy, "_NET_NUMBER_OF_DESKTOPS", False); - net_current_desktop = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False); - net_desktop_viewport = XInternAtom(dpy, "_NET_DESKTOP_VIEWPORT", False); - net_desktop_geometry = XInternAtom(dpy, "_NET_DESKTOP_GEOMETRY", False); - net_workarea = XInternAtom(dpy, "_NET_WORKAREA", False); - net_supporting_wm_check = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - net_supported = XInternAtom(dpy, "_NET_SUPPORTED", False); - net_wm_window_type = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - net_wm_window_type_desktop = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False); - net_wm_window_type_dock = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False); - net_wm_window_type_toolbar = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_TOOLBAR", False); - net_wm_window_type_menu = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_MENU", False); - net_wm_window_type_dialog = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - net_wm_window_type_normal = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_NORMAL", False); - net_wm_state_modal = XInternAtom(dpy, "_NET_WM_STATE_MODAL", False); - net_client_list = XInternAtom(dpy, "_NET_CLIENT_LIST", False); - net_client_list_stacking = XInternAtom(dpy, "_NET_CLIENT_LIST_STACKING", False); - net_wm_state_skip_taskbar = XInternAtom(dpy, "_NET_WM_STATE_SKIP_TASKBAR", False); - net_wm_state_skip_pager = XInternAtom(dpy, "_NET_WM_STATE_SKIP_PAGER", False); - net_wm_icon_name = XInternAtom(dpy, "_NET_WM_ICON_NAME", False); - net_wm_icon = XInternAtom(dpy, "_NET_WM_ICON", False); - net_wm_icon_geometry = XInternAtom(dpy, "_NET_WM_ICON_GEOMETRY", False); - net_wm_moveresize = XInternAtom(dpy, "_NET_WM_MOVERESIZE", False); - net_active_window = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - net_wm_strut = XInternAtom(dpy, "_NET_WM_STRUT", False); - net_wm_state_hidden = XInternAtom(dpy, "_NET_WM_STATE_HIDDEN", False); - net_wm_window_type_utility = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_UTILITY", False); + utf8_string = XInternAtom(dpy, "UTF8_STRING", False); + net_wm_name = XInternAtom(dpy, "_NET_WM_NAME", False); + net_close_window = XInternAtom(dpy, "_NET_CLOSE_WINDOW", False); + net_wm_state = XInternAtom(dpy, "_NET_WM_STATE", False); + net_wm_state_shaded = XInternAtom(dpy, "_NET_WM_STATE_SHADED", False); + net_wm_state_sticky = XInternAtom(dpy, "_NET_WM_STATE_STICKY", False); + net_wm_state_maximized_horz = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_HORZ", False); + net_wm_state_maximized_vert = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_VERT", False); + net_wm_state_fullscreen = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); + net_wm_desktop = XInternAtom(dpy, "_NET_WM_DESKTOP", False); + net_number_of_desktops = XInternAtom(dpy, "_NET_NUMBER_OF_DESKTOPS", False); + net_current_desktop = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False); + net_desktop_viewport = XInternAtom(dpy, "_NET_DESKTOP_VIEWPORT", False); + net_desktop_geometry = XInternAtom(dpy, "_NET_DESKTOP_GEOMETRY", False); + net_workarea = XInternAtom(dpy, "_NET_WORKAREA", False); + net_supporting_wm_check = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); + net_supported = XInternAtom(dpy, "_NET_SUPPORTED", False); + net_wm_window_type = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); + net_wm_window_type_desktop = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False); + net_wm_window_type_dock = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False); + net_wm_window_type_toolbar = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_TOOLBAR", False); + net_wm_window_type_menu = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_MENU", False); + net_wm_window_type_dialog = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); + net_wm_window_type_normal = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_NORMAL", False); + net_wm_state_modal = XInternAtom(dpy, "_NET_WM_STATE_MODAL", False); + net_client_list = XInternAtom(dpy, "_NET_CLIENT_LIST", False); + net_client_list_stacking = XInternAtom(dpy, "_NET_CLIENT_LIST_STACKING", False); + net_wm_state_skip_taskbar = XInternAtom(dpy, "_NET_WM_STATE_SKIP_TASKBAR", False); + net_wm_state_skip_pager = XInternAtom(dpy, "_NET_WM_STATE_SKIP_PAGER", False); + net_wm_icon_name = XInternAtom(dpy, "_NET_WM_ICON_NAME", False); + net_wm_icon = XInternAtom(dpy, "_NET_WM_ICON", False); + net_wm_icon_geometry = XInternAtom(dpy, "_NET_WM_ICON_GEOMETRY", False); + net_wm_moveresize = XInternAtom(dpy, "_NET_WM_MOVERESIZE", False); + net_active_window = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); + net_wm_strut = XInternAtom(dpy, "_NET_WM_STRUT", False); + net_wm_state_hidden = XInternAtom(dpy, "_NET_WM_STATE_HIDDEN", False); + net_wm_window_type_utility = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_UTILITY", False); net_wm_window_type_splashscreen = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_SPLASHSCREEN", False); } @@ -350,17 +350,17 @@ int getNetHint(Display * dpy, Window w, Atom a, long *value) DBG("entering getNetHint\n"); *value = 0; - - if((XGetWindowProperty (dpy, w, a, 0L, 1L, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, (unsigned char **)&data) == Success) && (items_read)) + + if((XGetWindowProperty(dpy, w, a, 0L, 1L, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, (unsigned char **)&data) == Success) && (items_read)) { *value = *data; - XFree(data); + XFree(data); success = True; } return (success); } -void set_net_supported_hint (Display * dpy, Window root_win, Window check_win) +void set_net_supported_hint(Display * dpy, Window root_win, Window check_win) { Atom atoms[32]; unsigned long data[1]; @@ -394,30 +394,30 @@ void set_net_supported_hint (Display * dpy, Window root_win, Window check_win) atoms[i++] = net_wm_state_skip_pager; atoms[i++] = net_wm_strut; /* Not supported (yet) - atoms[i++] = net_wm_moveresize; + atoms[i++] = net_wm_moveresize; */ atoms[i++] = net_wm_state_hidden; atoms[i++] = net_wm_window_type_utility; atoms[i++] = net_wm_window_type_splashscreen; /* Apparently not required - XChangeProperty (dpy, check_win, net_supported, XA_ATOM, 32, PropModeReplace, (unsigned char *) atoms, i); + XChangeProperty (dpy, check_win, net_supported, XA_ATOM, 32, PropModeReplace, (unsigned char *) atoms, i); */ - XChangeProperty (dpy, root_win, net_supported, XA_ATOM, 32, PropModeReplace, (unsigned char *) atoms, i); + XChangeProperty(dpy, root_win, net_supported, XA_ATOM, 32, PropModeReplace, (unsigned char *)atoms, i); data[0] = check_win; - XChangeProperty (dpy, root_win, net_supporting_wm_check, XA_WINDOW, 32, PropModeReplace, (unsigned char *) data, 1); + XChangeProperty(dpy, root_win, net_supporting_wm_check, XA_WINDOW, 32, PropModeReplace, (unsigned char *)data, 1); } -static int check_type_and_format (Display *dpy, Window w, Atom a, int expected_format, Atom expected_type, int n_items, int format, Atom type) +static int check_type_and_format(Display * dpy, Window w, Atom a, int expected_format, Atom expected_type, int n_items, int format, Atom type) { - if ((expected_format == format) && (expected_type == type) && (n_items < 0 || n_items > 0)) + if((expected_format == format) && (expected_type == type) && (n_items < 0 || n_items > 0)) { - return (True); + return (True); } return (False); } -int get_atom_list (Display *dpy, Window w, Atom a, Atom **atoms_p, int *n_atoms_p) +int get_atom_list(Display * dpy, Window w, Atom a, Atom ** atoms_p, int *n_atoms_p) { Atom type; int format; @@ -428,20 +428,20 @@ int get_atom_list (Display *dpy, Window w, Atom a, Atom **atoms_p, int *n_atoms *atoms_p = NULL; *n_atoms_p = 0; - if (XGetWindowProperty (dpy, w, a, 0L, 1L, False, XA_ATOM, &type, &format, &n_atoms, &bytes_after, (guchar **)&atoms) != Success || type == None) + if(XGetWindowProperty(dpy, w, a, 0L, 1L, False, XA_ATOM, &type, &format, &n_atoms, &bytes_after, (guchar **) & atoms) != Success || type == None) { - return (False); + return (False); } - if (!check_type_and_format (dpy, w, a, 32, XA_ATOM, -1, format, type)) + if(!check_type_and_format(dpy, w, a, 32, XA_ATOM, -1, format, type)) { - if (atoms) - { - XFree (atoms); - } - *atoms_p = NULL; - *n_atoms_p = 0; - return (False); + if(atoms) + { + XFree(atoms); + } + *atoms_p = NULL; + *n_atoms_p = 0; + return (False); } *atoms_p = atoms; @@ -450,7 +450,7 @@ int get_atom_list (Display *dpy, Window w, Atom a, Atom **atoms_p, int *n_atoms return (True); } -int get_cardinal_list (Display *dpy, Window w, Atom xatom, unsigned long **cardinals_p, int *n_cardinals_p) +int get_cardinal_list(Display * dpy, Window w, Atom xatom, unsigned long **cardinals_p, int *n_cardinals_p) { Atom type; int format; @@ -461,15 +461,15 @@ int get_cardinal_list (Display *dpy, Window w, Atom xatom, unsigned long **cardi *cardinals_p = NULL; *n_cardinals_p = 0; - if ((XGetWindowProperty (dpy, w, xatom, 0, 32, False, XA_CARDINAL, &type, &format, &n_cardinals, &bytes_after, (unsigned char **)&cardinals) != Success) || (type == None)) + if((XGetWindowProperty(dpy, w, xatom, 0, 32, False, XA_CARDINAL, &type, &format, &n_cardinals, &bytes_after, (unsigned char **)&cardinals) != Success) || (type == None)) { - return False; + return False; } - if (!check_type_and_format (dpy, w, xatom, 32, XA_CARDINAL, -1, format, type)) + if(!check_type_and_format(dpy, w, xatom, 32, XA_CARDINAL, -1, format, type)) { - XFree (cardinals); - return False; + XFree(cardinals); + return False; } *cardinals_p = cardinals; @@ -478,67 +478,66 @@ int get_cardinal_list (Display *dpy, Window w, Atom xatom, unsigned long **cardi return True; } -void set_net_workarea (Display * dpy, Window w, int nb_workspaces, CARD32 *margins) +void set_net_workarea(Display * dpy, Window w, int nb_workspaces, CARD32 * margins) { unsigned long *data, *ptr; int i, j; - + DBG("entering set_net_workarea\n"); j = (nb_workspaces ? nb_workspaces : 1); - data = (unsigned long *) malloc (sizeof (unsigned long) * j * 4); - if (!data) + data = (unsigned long *)malloc(sizeof(unsigned long) * j * 4); + if(!data) { gdk_beep(); return; } ptr = data; - for (i = 0; i < j; i++) + for(i = 0; i < j; i++) { - *ptr++ = margins[MARGIN_LEFT]; - *ptr++ = margins[MARGIN_TOP]; - *ptr++ = XDisplayWidth(dpy, screen) - (margins[MARGIN_LEFT] + margins[MARGIN_RIGHT]); - *ptr++ = XDisplayHeight(dpy, screen) - (margins[MARGIN_TOP] + margins[MARGIN_BOTTOM]); + *ptr++ = margins[MARGIN_LEFT]; + *ptr++ = margins[MARGIN_TOP]; + *ptr++ = XDisplayWidth(dpy, screen) - (margins[MARGIN_LEFT] + margins[MARGIN_RIGHT]); + *ptr++ = XDisplayHeight(dpy, screen) - (margins[MARGIN_TOP] + margins[MARGIN_BOTTOM]); } - XChangeProperty (dpy, w, net_workarea, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, j * 4); - free (data); + XChangeProperty(dpy, w, net_workarea, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, j * 4); + free(data); } -void init_net_desktop_params (Display * dpy, Window w, int workspace) +void init_net_desktop_params(Display * dpy, Window w, int workspace) { unsigned long data[2]; DBG("entering init_net_desktop_params\n"); data[0] = XDisplayWidth(dpy, screen); data[1] = XDisplayHeight(dpy, screen); - XChangeProperty (dpy, w, net_desktop_geometry, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 2); + XChangeProperty(dpy, w, net_desktop_geometry, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2); data[0] = 0; data[1] = 0; - XChangeProperty (dpy, w, net_desktop_viewport, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 2); - /* TBD : See why this prevents kdesktop from working properly */ + XChangeProperty(dpy, w, net_desktop_viewport, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2); + /* TBD : See why this prevents kdesktop from working properly */ data[0] = workspace; - XChangeProperty (dpy, w, net_current_desktop, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 1); + XChangeProperty(dpy, w, net_current_desktop, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); } -void -set_utf8_string_hint (Display *dpy, Window w, Atom atom, const char *val) +void set_utf8_string_hint(Display * dpy, Window w, Atom atom, const char *val) { DBG("entering set_utf8_string_hint\n"); - XChangeProperty (dpy, w, atom, utf8_string, 8, PropModeReplace, (unsigned char *) val, strlen (val) + 1); + XChangeProperty(dpy, w, atom, utf8_string, 8, PropModeReplace, (unsigned char *)val, strlen(val) + 1); } -void getTransientFor(Display * dpy, Window w, Window *transient_for) +void getTransientFor(Display * dpy, Window w, Window * transient_for) { DBG("entering getTransientFor\n"); - if (!XGetTransientForHint (dpy, w, transient_for)) + if(!XGetTransientForHint(dpy, w, transient_for)) { - *transient_for = None; + *transient_for = None; } DBG("Window (%#lx) is transient for (%#lx)\n", w, *transient_for); } -int get_utf8_string (Display *dpy, Window w, Atom xatom, char **str_p) +int get_utf8_string(Display * dpy, Window w, Atom xatom, char **str_p) { Atom type; int format; @@ -549,35 +548,35 @@ int get_utf8_string (Display *dpy, Window w, Atom xatom, char **str_p) DBG("entering get_utf8_string\n"); *str_p = NULL; - if ((XGetWindowProperty (dpy, w, xatom, 0, 32, False, utf8_string, &type, &format, &n_items, &bytes_after, (unsigned char **)&str) != Success) || (type == None)) + if((XGetWindowProperty(dpy, w, xatom, 0, 32, False, utf8_string, &type, &format, &n_items, &bytes_after, (unsigned char **)&str) != Success) || (type == None)) { DBG("no utf8_string value provided\n"); - return False; + return False; } - if (!check_type_and_format (dpy, w, xatom, 8, utf8_string, -1, format, type)) + if(!check_type_and_format(dpy, w, xatom, 8, utf8_string, -1, format, type)) { DBG("utf8_string value invalid\n"); - if (str) - { - XFree (str); - } - return False; + if(str) + { + XFree(str); + } + return False; } - if (!g_utf8_validate (str, n_items, NULL)) + if(!g_utf8_validate(str, n_items, NULL)) { - char *name; + char *name; - name = XGetAtomName (dpy, xatom); - if (name) - { - g_message("Property %s on window (%lx) contained invalid UTF-8\n", name, w); - XFree (name); - } - XFree (str); + name = XGetAtomName(dpy, xatom); + if(name) + { + g_message("Property %s on window (%lx) contained invalid UTF-8\n", name, w); + XFree(name); + } + XFree(str); - return False; + return False; } *str_p = str; @@ -585,7 +584,7 @@ int get_utf8_string (Display *dpy, Window w, Atom xatom, char **str_p) return True; } -static char* text_property_to_utf8 (Display *dpy, const XTextProperty *prop) +static char *text_property_to_utf8(Display * dpy, const XTextProperty * prop) { char **list; int count; @@ -594,37 +593,37 @@ static char* text_property_to_utf8 (Display *dpy, const XTextProperty *prop) DBG("entering text_property_to_utf8\n"); list = NULL; - if ((count = gdk_text_property_to_utf8_list (gdk_x11_xatom_to_atom (prop->encoding), prop->format, prop->value, prop->nitems, &list)) == 0) + if((count = gdk_text_property_to_utf8_list(gdk_x11_xatom_to_atom(prop->encoding), prop->format, prop->value, prop->nitems, &list)) == 0) { DBG("gdk_text_property_to_utf8_list returned 0\n"); - return NULL; + return NULL; } retval = list[0]; - list[0] = g_strdup (""); - g_strfreev (list); + list[0] = g_strdup(""); + g_strfreev(list); return retval; } -static char* get_text_property (Display *dpy, Window w, Atom a) +static char *get_text_property(Display * dpy, Window w, Atom a) { XTextProperty text; char *retval; DBG("entering get_text_property\n"); text.nitems = 0; - if (XGetTextProperty (dpy, w, &text, a)) + if(XGetTextProperty(dpy, w, &text, a)) { - retval = text_property_to_utf8 (dpy, &text); - if ((text.value) && (text.nitems > 0)) - { - XFree (text.value); - } + retval = text_property_to_utf8(dpy, &text); + if((text.value) && (text.nitems > 0)) + { + XFree(text.value); + } } else { - retval = NULL; - DBG("XGetTextProperty() failed\n"); + retval = NULL; + DBG("XGetTextProperty() failed\n"); } return retval; @@ -637,18 +636,18 @@ void getWindowName(Display * dpy, Window w, char **name) DBG("entering getWindowName\n"); *name = NULL; - if (get_utf8_string (dpy, w, net_wm_name, &str)) + if(get_utf8_string(dpy, w, net_wm_name, &str)) { *name = strdup(str); - XFree (str); - return; + XFree(str); + return; } - str = get_text_property (dpy, w, XA_WM_NAME); - if (str) + str = get_text_property(dpy, w, XA_WM_NAME); + if(str) { - *name = strdup (str); - XFree (str); - } + *name = strdup(str); + XFree(str); + } else { *name = strdup(""); diff --git a/src/hints.h b/src/hints.h index fe3f444b4..449dce534 100644 --- a/src/hints.h +++ b/src/hints.h @@ -28,37 +28,37 @@ #include <X11/Xatom.h> -#define MWM_HINTS_DECORATIONS (1L<<1) -#define MWM_DECOR_ALL (1L<<0) -#define MWM_DECOR_BORDER (1L<<1) -#define MWM_DECOR_TITLE (1L<<3) -#define MWM_DECOR_MAXIMIZE (1L<<6) - -#define WIN_STATE_STICKY (1L<<0) -#define WIN_STATE_MAXIMIZED_VERT (1L<<2) -#define WIN_STATE_MAXIMIZED_HORIZ (1L<<3) -#define WIN_STATE_MAXIMIZED ((1L<<2)|(1L<<3)) -#define WIN_STATE_SHADED (1L<<5) - -#define WIN_HINTS_SKIP_FOCUS (1L<<0) -#define WIN_HINTS_SKIP_TASKBAR (1L<<2) - -#define WIN_LAYER_DESKTOP 0 -#define WIN_LAYER_BELOW 2 -#define WIN_LAYER_NORMAL 4 -#define WIN_LAYER_ONTOP 6 -#define WIN_LAYER_DOCK 8 +#define MWM_HINTS_DECORATIONS (1L<<1) +#define MWM_DECOR_ALL (1L<<0) +#define MWM_DECOR_BORDER (1L<<1) +#define MWM_DECOR_TITLE (1L<<3) +#define MWM_DECOR_MAXIMIZE (1L<<6) + +#define WIN_STATE_STICKY (1L<<0) +#define WIN_STATE_MAXIMIZED_VERT (1L<<2) +#define WIN_STATE_MAXIMIZED_HORIZ (1L<<3) +#define WIN_STATE_MAXIMIZED ((1L<<2)|(1L<<3)) +#define WIN_STATE_SHADED (1L<<5) + +#define WIN_HINTS_SKIP_FOCUS (1L<<0) +#define WIN_HINTS_SKIP_TASKBAR (1L<<2) + +#define WIN_LAYER_DESKTOP 0 +#define WIN_LAYER_BELOW 2 +#define WIN_LAYER_NORMAL 4 +#define WIN_LAYER_ONTOP 6 +#define WIN_LAYER_DOCK 8 #define WIN_LAYER_ABOVE_DOCK 10 -#define NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 -#define NET_WM_MOVERESIZE_SIZE_TOP 1 -#define NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 -#define NET_WM_MOVERESIZE_SIZE_RIGHT 3 -#define NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 -#define NET_WM_MOVERESIZE_SIZE_BOTTOM 5 -#define NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 -#define NET_WM_MOVERESIZE_SIZE_LEFT 7 -#define NET_WM_MOVERESIZE_MOVE 8 +#define NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 +#define NET_WM_MOVERESIZE_SIZE_TOP 1 +#define NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 +#define NET_WM_MOVERESIZE_SIZE_RIGHT 3 +#define NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 +#define NET_WM_MOVERESIZE_SIZE_BOTTOM 5 +#define NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 +#define NET_WM_MOVERESIZE_SIZE_LEFT 7 +#define NET_WM_MOVERESIZE_MOVE 8 #define NET_WM_STATE_REMOVE 0 #define NET_WM_STATE_ADD 1 @@ -141,23 +141,23 @@ unsigned long getWMState(Display *, Window); void setWMState(Display *, Window, unsigned long state); void initMotifHints(Display *); PropMwmHints *getMotifHints(Display *, Window); -int getWMInput (Display *, Window); -int getWMTakeFocus (Display *, Window); +int getWMInput(Display *, Window); +int getWMTakeFocus(Display *, Window); void initGnomeHints(Display *); int getGnomeHint(Display *, Window, Atom, long *); void setGnomeHint(Display *, Window, Atom, long); void getGnomeDesktopMargins(Display *, CARD32 *); void initNetHints(Display * dpy); int getNetHint(Display *, Window, Atom, long *); -void set_net_supported_hint (Display *, Window, Window); -int get_atom_list (Display *, Window, Atom, Atom **, int *); -int get_cardinal_list (Display *, Window, Atom, unsigned long **, int *); -void set_net_workarea (Display *, Window, int, CARD32 *); -void init_net_desktop_params (Display *, Window, int); -void set_utf8_string_hint (Display *, Window, Atom, const char *); -void getTransientFor(Display * dpy, Window w, Window *transient_for); +void set_net_supported_hint(Display *, Window, Window); +int get_atom_list(Display *, Window, Atom, Atom **, int *); +int get_cardinal_list(Display *, Window, Atom, unsigned long **, int *); +void set_net_workarea(Display *, Window, int, CARD32 *); +void init_net_desktop_params(Display *, Window, int); +void set_utf8_string_hint(Display *, Window, Atom, const char *); +void getTransientFor(Display * dpy, Window w, Window * transient_for); void getWindowName(Display * dpy, Window w, char **name); -int get_utf8_string (Display *, Window, Atom, char **); +int get_utf8_string(Display *, Window, Atom, char **); void getWindowName(Display *, Window, char **); #define setNetHint setGnomeHint diff --git a/src/keyboard.c b/src/keyboard.c index 3e9435841..5f22c9557 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -70,10 +70,8 @@ void grabKey(Display * dpy, MyKey * key, Window w) if(key->keycode) { - XGrabKey(dpy, key->keycode, key->modifier, w, False, GrabModeAsync, - GrabModeAsync); - XGrabKey(dpy, key->keycode, key->modifier | LockMask, w, False, - GrabModeAsync, GrabModeAsync); + XGrabKey(dpy, key->keycode, key->modifier, w, False, GrabModeAsync, GrabModeAsync); + XGrabKey(dpy, key->keycode, key->modifier | LockMask, w, False, GrabModeAsync, GrabModeAsync); } } diff --git a/src/main.c b/src/main.c index 29ffd36c4..e18b37842 100644 --- a/src/main.c +++ b/src/main.c @@ -56,14 +56,13 @@ int handleXError(Display * dpy, XErrorEvent * err) case BadAccess: if(err->resourceid == root) { - fprintf(stderr, "%s: Another window manager is running\n", - progname); + fprintf(stderr, "%s: Another window manager is running\n", progname); exit(1); } - break; + break; default: - DBG("X error ignored\n"); - break; + DBG("X error ignored\n"); + break; } return 0; } @@ -94,9 +93,9 @@ void handleSignal(int sig) { case SIGINT: case SIGTERM: - gtk_main_quit (); + gtk_main_quit(); quit = True; - break; + break; case SIGHUP: reload = True; break; @@ -105,8 +104,8 @@ void handleSignal(int sig) cleanUp(); exit(1); break; - default: - break; + default: + break; } } @@ -117,21 +116,21 @@ void initialize(int argc, char **argv) long ws; DBG("entering initialize\n"); - + gtk_init(&argc, &argv); progname = argv[0]; - dpy = GDK_DISPLAY(); - root = GDK_ROOT_WINDOW(); - screen = XDefaultScreen(dpy); - depth = DefaultDepth(dpy, screen); - cmap = DefaultColormap(dpy, screen); - - margins[MARGIN_TOP] = gnome_margins[MARGIN_TOP] = 0; - margins[MARGIN_LEFT] = gnome_margins[MARGIN_LEFT] = 0; - margins[MARGIN_RIGHT] = gnome_margins[MARGIN_RIGHT] = 0; + dpy = GDK_DISPLAY(); + root = GDK_ROOT_WINDOW(); + screen = XDefaultScreen(dpy); + depth = DefaultDepth(dpy, screen); + cmap = DefaultColormap(dpy, screen); + + margins[MARGIN_TOP] = gnome_margins[MARGIN_TOP] = 0; + margins[MARGIN_LEFT] = gnome_margins[MARGIN_LEFT] = 0; + margins[MARGIN_RIGHT] = gnome_margins[MARGIN_RIGHT] = 0; margins[MARGIN_BOTTOM] = gnome_margins[MARGIN_BOTTOM] = 0; - + XSetErrorHandler(handleXError); shape = XShapeQueryExtension(dpy, &shape_event, &dummy); @@ -142,22 +141,20 @@ void initialize(int argc, char **argv) root_cursor = XCreateFontCursor(dpy, XC_left_ptr); move_cursor = XCreateFontCursor(dpy, XC_fleur); - 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_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); - + 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); - initEventFilter(SubstructureNotifyMask | StructureNotifyMask | SubstructureRedirectMask | - ButtonPressMask | ButtonReleaseMask | FocusChangeMask | - PropertyChangeMask | ColormapNotify, NULL, "xfwm"); - pushEventFilter (xfwm4_event_filter, NULL); + initEventFilter(SubstructureNotifyMask | StructureNotifyMask | SubstructureRedirectMask | ButtonPressMask | ButtonReleaseMask | FocusChangeMask | PropertyChangeMask | ColormapNotify, NULL, "xfwm"); + pushEventFilter(xfwm4_event_filter, NULL); - gnome_win = getDefaultXWindow (); + gnome_win = getDefaultXWindow(); initSettings(); loadSettings(); @@ -173,15 +170,15 @@ void initialize(int argc, char **argv) setGnomeHint(dpy, root, win_desktop_button_proxy, gnome_win); setGnomeHint(dpy, gnome_win, win_desktop_button_proxy, gnome_win); getGnomeHint(dpy, root, win_workspace, &ws); - workspace = (int) ws; + workspace = (int)ws; getGnomeDesktopMargins(dpy, gnome_margins); - set_utf8_string_hint (dpy, gnome_win, net_wm_name, "Xfwm4"); - set_net_supported_hint (dpy, root, gnome_win); + set_utf8_string_hint(dpy, gnome_win, net_wm_name, "Xfwm4"); + set_net_supported_hint(dpy, root, gnome_win); workspaceUpdateArea(margins, gnome_margins); - init_net_desktop_params (dpy, root, workspace); - set_net_workarea (dpy, root, workspace_count, margins); + init_net_desktop_params(dpy, root, workspace); + set_net_workarea(dpy, root, workspace_count, margins); XSetInputFocus(dpy, gnome_win, RevertToNone, CurrentTime); - initGtkCallbacks (); + initGtkCallbacks(); clientFrameAll(); } diff --git a/src/menu.c b/src/menu.c index 34fa9df4a..aa7826e6b 100644 --- a/src/menu.c +++ b/src/menu.c @@ -34,46 +34,46 @@ static GtkWidget *menu_open = NULL; static MenuItem menuitems[] = { - { MENU_OP_MAXIMIZE, NULL, "Maximize" }, - { MENU_OP_UNMAXIMIZE, NULL, "Unmaximize" }, - { MENU_OP_MINIMIZE, NULL, "Hide" }, - { MENU_OP_MINIMIZE_ALL, NULL, "Hide all others" }, - { MENU_OP_UNMINIMIZE, NULL, "Show" }, - { MENU_OP_SHADE, NULL, "Shade" }, - { MENU_OP_UNSHADE, NULL, "Unshade" }, - { MENU_OP_STICK, NULL, "Stick" }, - { MENU_OP_UNSTICK, NULL, "Unstick" }, - { MENU_OP_MOVE, NULL, "Move" }, - { MENU_OP_RESIZE, NULL, "Resize" }, - { MENU_OP_SWITCH, NULL, "Switch" }, - { MENU_OP_DELETE, NULL, "Close" }, - { 0, NULL, NULL }, - { MENU_OP_DESTROY, NULL, "Destroy" }, + {MENU_OP_MAXIMIZE, NULL, "Maximize"}, + {MENU_OP_UNMAXIMIZE, NULL, "Unmaximize"}, + {MENU_OP_MINIMIZE, NULL, "Hide"}, + {MENU_OP_MINIMIZE_ALL, NULL, "Hide all others"}, + {MENU_OP_UNMINIMIZE, NULL, "Show"}, + {MENU_OP_SHADE, NULL, "Shade"}, + {MENU_OP_UNSHADE, NULL, "Unshade"}, + {MENU_OP_STICK, NULL, "Stick"}, + {MENU_OP_UNSTICK, NULL, "Unstick"}, + {MENU_OP_MOVE, NULL, "Move"}, + {MENU_OP_RESIZE, NULL, "Resize"}, + {MENU_OP_SWITCH, NULL, "Switch"}, + {MENU_OP_DELETE, NULL, "Close"}, + {0, NULL, NULL}, + {MENU_OP_DESTROY, NULL, "Destroy"}, #if 0 - { 0, NULL, NULL }, - { MENU_OP_WORKSPACES, NULL, "Workspace" }, - { 0, NULL, NULL }, + {0, NULL, NULL}, + {MENU_OP_WORKSPACES, NULL, "Workspace"}, + {0, NULL, NULL}, #endif - { MENU_OP_QUIT, NULL, "Quit" }, - { MENU_OP_RESTART, NULL, "Restart" }, + {MENU_OP_QUIT, NULL, "Quit"}, + {MENU_OP_RESTART, NULL, "Restart"}, }; -static GtkToXEventFilterStatus menu_filter(XEvent *xevent, gpointer data) +static GtkToXEventFilterStatus menu_filter(XEvent * xevent, gpointer data) { - switch (xevent->type) + 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; } @@ -81,61 +81,57 @@ static GtkToXEventFilterStatus menu_filter(XEvent *xevent, gpointer data) static void #if ((GTK_MAJOR_VERSION <= 1) && (GTK_MINOR_VERSION <= 2)) -popup_position_func (GtkMenu *menu, gint *x, gint *y, gpointer user_data) +popup_position_func(GtkMenu * menu, gint * x, gint * y, gpointer user_data) #else -popup_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data) +popup_position_func(GtkMenu * menu, gint * x, gint * y, gboolean * push_in, gpointer user_data) #endif { - GtkRequisition req; + GtkRequisition req; GdkPoint *pos; pos = user_data; - gtk_widget_size_request (GTK_WIDGET (menu), &req); + gtk_widget_size_request(GTK_WIDGET(menu), &req); - if (pos->x >= 0) + 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) + 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); + g_free(user_data); } -static gboolean activate_cb (GtkWidget *menuitem, gpointer data) +static gboolean activate_cb(GtkWidget * menuitem, gpointer data) { MenuData *md; DBG("entering activate_cb\n"); - g_return_val_if_fail (GTK_IS_WIDGET (menuitem), FALSE); + g_return_val_if_fail(GTK_IS_WIDGET(menuitem), FALSE); menu_open = NULL; md = data; DBG("deactivating menu_filter\n"); - popEventFilter (); - (* md->menu->func) (md->menu, - md->op, - md->client_xwindow, - md->menu->data, - md->data); + popEventFilter(); + (*md->menu->func) (md->menu, md->op, md->client_xwindow, md->menu->data, md->data); return (FALSE); } -static gboolean menu_closed (GtkMenu *widget, gpointer data) +static gboolean menu_closed(GtkMenu * widget, gpointer data) { Menu *menu; @@ -143,197 +139,194 @@ static gboolean menu_closed (GtkMenu *widget, gpointer data) menu = data; menu_open = NULL; DBG("deactivating menu_filter\n"); - popEventFilter (); - (* menu->func) (menu, 0, None, menu->data, NULL); + popEventFilter(); + (*menu->func) (menu, 0, None, menu->data, NULL); return (FALSE); } -Menu* menu_default (MenuOp ops, MenuOp insensitive, MenuFunc func, gpointer data) +Menu *menu_default(MenuOp ops, MenuOp insensitive, MenuFunc func, gpointer data) { int i; Menu *menu; DBG("entering menu_new\n"); - menu = g_new (Menu, 1); + menu = g_new(Menu, 1); menu->func = func; menu->data = data; menu->ops = ops; menu->insensitive = insensitive; - menu->menu = gtk_menu_new (); + menu->menu = gtk_menu_new(); i = 0; - while (i < (int) (sizeof (menuitems) / sizeof (MenuItem))) + while(i < (int)(sizeof(menuitems) / sizeof(MenuItem))) { - if (ops & menuitems[i].op || menuitems[i].op == 0) + if(ops & menuitems[i].op || menuitems[i].op == 0) { - GtkWidget *mi; - MenuData *md; + GtkWidget *mi; + MenuData *md; - if (menuitems[i].op == 0) - { + if(menuitems[i].op == 0) + { #if ((GTK_MAJOR_VERSION <= 1) && (GTK_MINOR_VERSION <= 2)) - mi = gtk_menu_item_new (); + mi = gtk_menu_item_new(); #else - mi = gtk_separator_menu_item_new (); + mi = gtk_separator_menu_item_new(); #endif - } - else - { + } + else + { #if ((GTK_MAJOR_VERSION <= 1) && (GTK_MINOR_VERSION <= 2)) - mi = gtk_menu_item_new_with_label (menuitems[i].label); + mi = gtk_menu_item_new_with_label(menuitems[i].label); #else - mi = gtk_menu_item_new_with_mnemonic (menuitems[i].label); + mi = gtk_menu_item_new_with_mnemonic(menuitems[i].label); #endif - 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); + 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); } - gtk_menu_shell_append (GTK_MENU_SHELL (menu->menu), mi); - gtk_widget_show (mi); - } - ++i; + gtk_menu_shell_append(GTK_MENU_SHELL(menu->menu), mi); + gtk_widget_show(mi); + } + ++i; } - menu_connect (menu); + menu_connect(menu); return (menu); } -Menu* menu_connect (Menu *menu) +Menu *menu_connect(Menu * menu) { DBG("entering menu_connect\n"); - 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); + 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); return (menu); } -static void closure_notify (gpointer data, GClosure *closure) +static void closure_notify(gpointer data, GClosure * closure) { DBG("entering closure_notify\n"); - if (data) + if(data) { DBG("freeing data\n"); - g_free (data); + g_free(data); } } -GtkWidget* menu_item_connect (GtkWidget *item, MenuData *item_data) +GtkWidget *menu_item_connect(GtkWidget * item, MenuData * item_data) { DBG("entering menu_item_connect\n"); - 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_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); return (item); } -gboolean menu_is_opened (void) +gboolean menu_is_opened(void) { DBG("entering menu_is_opened\n"); return (menu_open != NULL); } -gboolean menu_check_and_close (void) +gboolean menu_check_and_close(void) { DBG("entering menu_check_or_close\n"); - if (menu_open) + if(menu_open) { - DBG("menu open, emitting deactivate signal\n"); - g_signal_emit_by_name (GTK_OBJECT (menu_open), "deactivate"); - menu_open = NULL; - return (TRUE); + DBG("menu open, emitting deactivate signal\n"); + g_signal_emit_by_name(GTK_OBJECT(menu_open), "deactivate"); + menu_open = NULL; + return (TRUE); } return (FALSE); } -static gboolean grab_available (guint32 timestamp) +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; + GdkEventMask 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; gint i = 0; - + DBG("entering grab_available\n"); - - g1 = gdk_pointer_grab (getGdkEventWindow (), TRUE, mask, NULL, NULL, timestamp); - g2 = gdk_keyboard_grab (getGdkEventWindow (), TRUE, timestamp); - - while ((i++ < 100) && (grab_failed = ((g1 != GDK_GRAB_SUCCESS) || (g2 != GDK_GRAB_SUCCESS)))) + + g1 = gdk_pointer_grab(getGdkEventWindow(), TRUE, mask, NULL, NULL, timestamp); + g2 = gdk_keyboard_grab(getGdkEventWindow(), TRUE, timestamp); + + while((i++ < 100) && (grab_failed = ((g1 != GDK_GRAB_SUCCESS) || (g2 != GDK_GRAB_SUCCESS)))) { DBG("grab not available yet, waiting... (%i)\n", i); - 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); - } + 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); + } } - - if (g1 == GDK_GRAB_SUCCESS) + + if(g1 == GDK_GRAB_SUCCESS) { - gdk_pointer_ungrab (timestamp); + gdk_pointer_ungrab(timestamp); } - if (g2 == GDK_GRAB_SUCCESS) + if(g2 == GDK_GRAB_SUCCESS) { - gdk_keyboard_ungrab (timestamp); + gdk_keyboard_ungrab(timestamp); } - + return (!grab_failed); } -void menu_popup (Menu *menu, int root_x, int root_y, int button, guint32 timestamp) +void menu_popup(Menu * menu, int root_x, int root_y, int button, guint32 timestamp) { GdkPoint *pt; DBG("entering menu_popup\n"); - g_return_if_fail (menu != NULL); - g_return_if_fail (GTK_IS_MENU (menu->menu)); - pt = g_new (GdkPoint, 1); + g_return_if_fail(menu != NULL); + g_return_if_fail(GTK_IS_MENU(menu->menu)); + pt = g_new(GdkPoint, 1); pt->x = root_x; pt->y = root_y; - if (!menu_check_and_close()) + if(!menu_check_and_close()) { - if (!grab_available(timestamp)) - { - g_free (pt); - DBG("Cannot get grab on pointer/keyboard, cancel.\n"); - return; - } - DBG("opening new menu\n"); - menu_open = menu->menu; - pushEventFilter (menu_filter, NULL); - gtk_menu_popup (GTK_MENU(menu->menu), NULL, NULL, popup_position_func, pt, button, timestamp); - if (!GTK_MENU_SHELL (GTK_MENU(menu->menu))->have_xgrab) - { - gdk_beep (); - g_message ("GtkMenu failed to grab the pointer\n"); - } + if(!grab_available(timestamp)) + { + g_free(pt); + DBG("Cannot get grab on pointer/keyboard, cancel.\n"); + return; + } + DBG("opening new menu\n"); + menu_open = menu->menu; + pushEventFilter(menu_filter, NULL); + gtk_menu_popup(GTK_MENU(menu->menu), NULL, NULL, popup_position_func, pt, button, timestamp); + if(!GTK_MENU_SHELL(GTK_MENU(menu->menu))->have_xgrab) + { + gdk_beep(); + g_message("GtkMenu failed to grab the pointer\n"); + } } } -void menu_free (Menu *menu) +void menu_free(Menu * menu) { DBG("entering menu_free\n"); - g_return_if_fail (menu != NULL); - g_return_if_fail (menu->menu != NULL); - g_return_if_fail (GTK_IS_MENU (menu->menu)); + g_return_if_fail(menu != NULL); + g_return_if_fail(menu->menu != NULL); + g_return_if_fail(GTK_IS_MENU(menu->menu)); DBG("freeing menu\n"); - gtk_widget_destroy (menu->menu); - g_free (menu); + gtk_widget_destroy(menu->menu); + g_free(menu); } - diff --git a/src/menu.h b/src/menu.h index 36b7eee40..9ec65d39a 100644 --- a/src/menu.h +++ b/src/menu.h @@ -29,69 +29,66 @@ #include <gdk/gdk.h> #include <X11/Xlib.h> -typedef enum +typedef enum { - MENU_OP_MAXIMIZE = 1 << 0, - MENU_OP_UNMAXIMIZE = 1 << 1, - MENU_OP_MINIMIZE = 1 << 2, - MENU_OP_MINIMIZE_ALL = 1 << 3, - MENU_OP_UNMINIMIZE = 1 << 4, - MENU_OP_SHADE = 1 << 5, - MENU_OP_UNSHADE = 1 << 6, - MENU_OP_STICK = 1 << 7, - MENU_OP_UNSTICK = 1 << 8, - MENU_OP_MOVE = 1 << 9, - MENU_OP_RESIZE = 1 << 10, - MENU_OP_DELETE = 1 << 11, - MENU_OP_DESTROY = 1 << 12, - MENU_OP_WORKSPACES = 1 << 13, - MENU_OP_QUIT = 1 << 14, - MENU_OP_RESTART = 1 << 15, - MENU_OP_SWITCH = 1 << 16, - MENU_OP_OTHER = 1 << 17 -} MenuOp; + MENU_OP_MAXIMIZE = 1 << 0, + MENU_OP_UNMAXIMIZE = 1 << 1, + MENU_OP_MINIMIZE = 1 << 2, + MENU_OP_MINIMIZE_ALL = 1 << 3, + MENU_OP_UNMINIMIZE = 1 << 4, + MENU_OP_SHADE = 1 << 5, + MENU_OP_UNSHADE = 1 << 6, + MENU_OP_STICK = 1 << 7, + MENU_OP_UNSTICK = 1 << 8, + MENU_OP_MOVE = 1 << 9, + MENU_OP_RESIZE = 1 << 10, + MENU_OP_DELETE = 1 << 11, + MENU_OP_DESTROY = 1 << 12, + MENU_OP_WORKSPACES = 1 << 13, + MENU_OP_QUIT = 1 << 14, + MENU_OP_RESTART = 1 << 15, + MENU_OP_SWITCH = 1 << 16, + MENU_OP_OTHER = 1 << 17 +} +MenuOp; typedef struct _Menu Menu; typedef struct _MenuItem MenuItem; typedef struct _MenuData MenuData; -typedef void (* MenuFunc) (Menu *menu, - MenuOp op, - Window client_xwindow, - gpointer menu_data, - gpointer item_data); +typedef void (*MenuFunc) (Menu * menu, MenuOp op, Window client_xwindow, gpointer menu_data, gpointer item_data); struct _MenuItem { - MenuOp op; + MenuOp op; const char *stock_id; const char *label; }; struct _MenuData { - Menu *menu; - MenuOp op; - Window client_xwindow; + Menu *menu; + MenuOp op; + Window client_xwindow; gpointer data; }; struct _Menu { GtkWidget *menu; - MenuFunc func; - gpointer data; - MenuOp ops; - MenuOp insensitive; + MenuFunc func; + gpointer data; + MenuOp ops; + MenuOp insensitive; }; -Menu* menu_default (MenuOp ops, MenuOp insensitive, MenuFunc func, gpointer data); -Menu* menu_connect (Menu *menu); -GtkWidget* menu_item_connect (GtkWidget *item, MenuData *item_data); -gboolean menu_is_window (Window); -gboolean menu_is_opened (void); -gboolean menu_check_and_close (void); -void menu_popup (Menu *menu, int root_x, int root_y, int button, guint32 timestamp); -void menu_free (Menu *menu); +Menu *menu_default(MenuOp ops, MenuOp insensitive, MenuFunc func, gpointer data); +Menu *menu_connect(Menu * menu); +GtkWidget *menu_item_connect(GtkWidget * item, MenuData * item_data); +gboolean menu_is_window(Window); +gboolean menu_is_opened(void); +gboolean menu_check_and_close(void); +void menu_popup(Menu * menu, int root_x, int root_y, int button, guint32 timestamp); +void menu_free(Menu * menu); #endif /* __MENU_H__ */ diff --git a/src/misc.c b/src/misc.c index 7ad041d47..5329989f2 100644 --- a/src/misc.c +++ b/src/misc.c @@ -100,31 +100,29 @@ void sendClientMessage(Display * dpy, Window w, Atom a, long x, int mask) XSync(dpy, False); } -void -MyXGrabServer (Display *dpy) +void MyXGrabServer(Display * dpy) { DBG("entering MyXGrabServer\n"); - if (xgrabcount == 0) + if(xgrabcount == 0) { DBG("grabbing server\n"); - XGrabServer (dpy); + XGrabServer(dpy); } xgrabcount++; DBG("grabs : %i\n", xgrabcount); } -void -MyXUngrabServer (Display *dpy) +void MyXUngrabServer(Display * dpy) { DBG("entering MyXUngrabServer\n"); - if (--xgrabcount < 0) /* should never happen */ + if(--xgrabcount < 0) /* should never happen */ { - xgrabcount = 0; + xgrabcount = 0; } - if (xgrabcount == 0) + if(xgrabcount == 0) { DBG("ungrabbing server\n"); - XUngrabServer (dpy); + XUngrabServer(dpy); } DBG("grabs : %i\n", xgrabcount); } diff --git a/src/misc.h b/src/misc.h index baf4c0398..32a23c1ab 100644 --- a/src/misc.h +++ b/src/misc.h @@ -32,7 +32,7 @@ void getMouseXY(Display *, Window, int *, int *); Window getMouseWindow(Display *, Window); GC createGC(Display *, Colormap, char *, int, XFontStruct *, int); void sendClientMessage(Display *, Window, Atom, long, int); -void MyXGrabServer (Display *); -void MyXUngrabServer (Display *); +void MyXGrabServer(Display *); +void MyXUngrabServer(Display *); #endif /* __MISC_H__ */ diff --git a/src/parserc.c b/src/parserc.c index d9ba81904..448af0c4f 100644 --- a/src/parserc.c +++ b/src/parserc.c @@ -30,7 +30,7 @@ #include "settings.h" #include "debug.h" -gboolean parseRc(gchar *file, gchar *dir, Settings rc[]) +gboolean parseRc(gchar * file, gchar * dir, Settings rc[]) { gchar filename[512], buf[512], *lvalue, *rvalue; FILE *fp; @@ -64,10 +64,10 @@ gboolean parseRc(gchar *file, gchar *dir, Settings rc[]) if(rvalue) { if(rc[i].value) - { + { g_free(rc[i].value); } - rc[i].value = g_strdup(rvalue); + rc[i].value = g_strdup(rvalue); DBG("%s=%s\n", rc[i].option, rc[i].value); } } @@ -96,7 +96,7 @@ gboolean checkRc(Settings rc[]) return rval; } -gchar *getValue(gchar *option, Settings rc[]) +gchar *getValue(gchar * option, Settings rc[]) { gint i; @@ -105,9 +105,9 @@ gchar *getValue(gchar *option, Settings rc[]) for(i = 0; rc[i].option; i++) { if(!g_strcasecmp(option, rc[i].option)) - { + { break; - } + } } return rc[i].value; } diff --git a/src/parserc.h b/src/parserc.h index 1518c03fc..7c62074ad 100644 --- a/src/parserc.h +++ b/src/parserc.h @@ -32,8 +32,8 @@ typedef struct _Settings Settings; struct _Settings { - gchar *option; - gchar *value; + gchar *option; + gchar *value; gboolean required; }; diff --git a/src/pixmap.c b/src/pixmap.c index c8ac022df..8c2dccfa4 100644 --- a/src/pixmap.c +++ b/src/pixmap.c @@ -32,7 +32,7 @@ #include "main.h" #include "debug.h" -gboolean loadPixmap(Display * dpy, MyPixmap * pm, gchar *dir, gchar *file, XpmColorSymbol * cs, gint n) +gboolean loadPixmap(Display * dpy, MyPixmap * pm, gchar * dir, gchar * file, XpmColorSymbol * cs, gint n) { gchar filename[512]; XpmAttributes attr; @@ -40,20 +40,20 @@ gboolean loadPixmap(Display * dpy, MyPixmap * pm, gchar *dir, gchar *file, XpmCo DBG("entering loadPixmap\n"); pm->pixmap = None; - pm->mask = None; - pm->width = 1; + pm->mask = None; + pm->width = 1; pm->height = 1; g_snprintf(filename, sizeof(filename), "%s/%s", dir, file); attr.colorsymbols = cs; - attr.numsymbols = n; - attr.colormap = cmap; - attr.closeness = 65535; - attr.valuemask = XpmCloseness | XpmColormap | XpmSize; + attr.numsymbols = n; + attr.colormap = cmap; + attr.closeness = 65535; + attr.valuemask = XpmCloseness | XpmColormap | XpmSize; if(n > 0 && cs) { attr.valuemask = attr.valuemask | XpmColorSymbols; } - if(XpmReadFileToPixmap (dpy, XDefaultRootWindow(dpy), filename, &pm->pixmap, &pm->mask, &attr)) + if(XpmReadFileToPixmap(dpy, XDefaultRootWindow(dpy), filename, &pm->pixmap, &pm->mask, &attr)) { return FALSE; } @@ -66,8 +66,8 @@ gboolean loadPixmap(Display * dpy, MyPixmap * pm, gchar *dir, gchar *file, XpmCo void createPixmap(Display * dpy, MyPixmap * pm, gint width, gint height) { pm->pixmap = XCreatePixmap(dpy, root, width, height, depth); - pm->mask = XCreatePixmap(dpy, pm->pixmap, width, height, 1); - pm->width = width; + pm->mask = XCreatePixmap(dpy, pm->pixmap, width, height, 1); + pm->width = width; pm->height = height; } diff --git a/src/settings.c b/src/settings.c index d29130526..f6a40ba3b 100644 --- a/src/settings.c +++ b/src/settings.c @@ -60,83 +60,83 @@ MyPixmap title[5][2]; void loadSettings() { Settings rc[] = { - {"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_shadow_1", NULL, FALSE}, - {"inactive_shadow_1", NULL, FALSE}, - {"active_hilight_1", NULL, FALSE}, - {"inactive_hilight_1", NULL, FALSE}, - {"active_color_2", NULL, FALSE}, - {"inactive_color_2", NULL, FALSE}, - {"active_shadow_2", NULL, FALSE}, - {"inactive_shadow_2", NULL, FALSE}, - {"active_hilight_2", NULL, FALSE}, - {"inactive_hilight_2", NULL, FALSE}, - {"theme", NULL, TRUE }, - {"title_alignment", NULL, TRUE }, - {"full_width_title", NULL, TRUE }, - {"button_layout", NULL, TRUE }, - {"button_spacing", NULL, TRUE }, - {"title_vertical_offset", NULL, TRUE }, - {"button_offset", NULL, TRUE }, - {"double_click_action", NULL, TRUE }, - {"box_move", NULL, TRUE }, - {"box_resize", NULL, TRUE }, - {"click_to_focus", NULL, TRUE }, - {"focus_new", NULL, TRUE }, - {"raise_on_focus", NULL, TRUE }, - {"raise_delay", NULL, TRUE }, - {"window_placement", NULL, TRUE }, - {"snap_to_border", NULL, TRUE }, - {"snap_width", NULL, TRUE }, - {"workspace_count", NULL, TRUE }, - {"wrap_workspaces", NULL, TRUE }, - {"close_window_key", NULL, TRUE }, - {"hide_window_key", NULL, TRUE }, - {"maximize_window_key", NULL, TRUE }, - {"maximize_vert_key", NULL, TRUE }, - {"maximize_horiz_key", NULL, TRUE }, - {"shade_window_key", NULL, TRUE }, - {"lower_window_layer_key", NULL, TRUE }, - {"raise_window_layer_key", NULL, TRUE }, - {"cycle_windows_key", NULL, TRUE }, - {"move_window_up_key", NULL, TRUE }, - {"move_window_down_key", NULL, TRUE }, - {"move_window_left_key", NULL, TRUE }, - {"move_window_right_key", NULL, TRUE }, - {"resize_window_up_key", NULL, TRUE }, - {"resize_window_down_key", NULL, TRUE }, - {"resize_window_left_key", NULL, TRUE }, - {"resize_window_right_key", NULL, TRUE }, - {"next_workspace_key", NULL, TRUE }, - {"prev_workspace_key", NULL, TRUE }, - {"add_workspace_key", NULL, TRUE }, - {"del_workspace_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 }, - {"move_window_next_workspace_key", NULL, TRUE }, - {"move_window_prev_workspace_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 }, - {NULL, NULL, FALSE} + {"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_shadow_1", NULL, FALSE}, + {"inactive_shadow_1", NULL, FALSE}, + {"active_hilight_1", NULL, FALSE}, + {"inactive_hilight_1", NULL, FALSE}, + {"active_color_2", NULL, FALSE}, + {"inactive_color_2", NULL, FALSE}, + {"active_shadow_2", NULL, FALSE}, + {"inactive_shadow_2", NULL, FALSE}, + {"active_hilight_2", NULL, FALSE}, + {"inactive_hilight_2", NULL, FALSE}, + {"theme", NULL, TRUE}, + {"title_alignment", NULL, TRUE}, + {"full_width_title", NULL, TRUE}, + {"button_layout", NULL, TRUE}, + {"button_spacing", NULL, TRUE}, + {"title_vertical_offset", NULL, TRUE}, + {"button_offset", NULL, TRUE}, + {"double_click_action", NULL, TRUE}, + {"box_move", NULL, TRUE}, + {"box_resize", NULL, TRUE}, + {"click_to_focus", NULL, TRUE}, + {"focus_new", NULL, TRUE}, + {"raise_on_focus", NULL, TRUE}, + {"raise_delay", NULL, TRUE}, + {"window_placement", NULL, TRUE}, + {"snap_to_border", NULL, TRUE}, + {"snap_width", NULL, TRUE}, + {"workspace_count", NULL, TRUE}, + {"wrap_workspaces", NULL, TRUE}, + {"close_window_key", NULL, TRUE}, + {"hide_window_key", NULL, TRUE}, + {"maximize_window_key", NULL, TRUE}, + {"maximize_vert_key", NULL, TRUE}, + {"maximize_horiz_key", NULL, TRUE}, + {"shade_window_key", NULL, TRUE}, + {"lower_window_layer_key", NULL, TRUE}, + {"raise_window_layer_key", NULL, TRUE}, + {"cycle_windows_key", NULL, TRUE}, + {"move_window_up_key", NULL, TRUE}, + {"move_window_down_key", NULL, TRUE}, + {"move_window_left_key", NULL, TRUE}, + {"move_window_right_key", NULL, TRUE}, + {"resize_window_up_key", NULL, TRUE}, + {"resize_window_down_key", NULL, TRUE}, + {"resize_window_left_key", NULL, TRUE}, + {"resize_window_right_key", NULL, TRUE}, + {"next_workspace_key", NULL, TRUE}, + {"prev_workspace_key", NULL, TRUE}, + {"add_workspace_key", NULL, TRUE}, + {"del_workspace_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}, + {"move_window_next_workspace_key", NULL, TRUE}, + {"move_window_prev_workspace_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}, + {NULL, NULL, FALSE} }; char *theme; XpmColorSymbol colsym[16]; @@ -144,24 +144,24 @@ void loadSettings() DBG("entering settingsLoad\n"); - widget = getDefaultGtkWidget (); - - rc[0].value = get_style (widget, "text", "selected"); - rc[1].value = get_style (widget, "text", "normal"); - rc[2].value = get_style (widget, "fg", "active"); - rc[3].value = get_style (widget, "fg", "normal"); - rc[4].value = get_style (widget, "bg", "selected"); - rc[5].value = get_style (widget, "light", "selected"); - rc[6].value = get_style (widget, "dark", "selected"); - rc[7].value = get_style (widget, "bg", "normal"); - rc[8].value = get_style (widget, "light", "normal"); - rc[9].value = get_style (widget, "dark", "normal"); - rc[10].value = get_style (widget, "bg", "active"); - rc[11].value = get_style (widget, "light", "active"); - rc[12].value = get_style (widget, "dark", "active"); - rc[13].value = get_style (widget, "bg", "normal"); - rc[14].value = get_style (widget, "light", "normal"); - rc[15].value = get_style (widget, "dark", "normal"); + widget = getDefaultGtkWidget(); + + rc[0].value = get_style(widget, "text", "selected"); + rc[1].value = get_style(widget, "text", "normal"); + rc[2].value = get_style(widget, "fg", "active"); + rc[3].value = get_style(widget, "fg", "normal"); + rc[4].value = get_style(widget, "bg", "selected"); + rc[5].value = get_style(widget, "light", "selected"); + rc[6].value = get_style(widget, "dark", "selected"); + rc[7].value = get_style(widget, "bg", "normal"); + rc[8].value = get_style(widget, "light", "normal"); + rc[9].value = get_style(widget, "dark", "normal"); + rc[10].value = get_style(widget, "bg", "active"); + rc[11].value = get_style(widget, "light", "active"); + rc[12].value = get_style(widget, "dark", "active"); + rc[13].value = get_style(widget, "bg", "normal"); + rc[14].value = get_style(widget, "light", "normal"); + rc[15].value = get_style(widget, "dark", "normal"); if(!parseRc("defaults", DATADIR, rc)) { @@ -177,157 +177,157 @@ void loadSettings() parseRc(".xfwm4rc", getenv("HOME"), rc); theme = getValue("theme", rc); parseRc("themerc", theme, rc); - - colsym[0].name = "active_text_color"; - colsym[0].value = rc[0].value; - - colsym[1].name = "inactive_text_color"; - colsym[1].value = rc[1].value; - - colsym[2].name = "active_border_color"; - colsym[2].value = rc[2].value; - - colsym[3].name = "inactive_border_color"; - colsym[3].value = rc[3].value; - - colsym[4].name = "active_color_1"; - colsym[4].value = rc[4].value; - - colsym[5].name = "active_hilight_1"; - colsym[5].value = rc[5].value; - - colsym[6].name = "active_shadow_1"; - colsym[6].value = rc[6].value; - - colsym[7].name = "active_color_2"; + + colsym[0].name = "active_text_color"; + colsym[0].value = rc[0].value; + + colsym[1].name = "inactive_text_color"; + colsym[1].value = rc[1].value; + + colsym[2].name = "active_border_color"; + colsym[2].value = rc[2].value; + + colsym[3].name = "inactive_border_color"; + colsym[3].value = rc[3].value; + + colsym[4].name = "active_color_1"; + colsym[4].value = rc[4].value; + + colsym[5].name = "active_hilight_1"; + colsym[5].value = rc[5].value; + + colsym[6].name = "active_shadow_1"; + colsym[6].value = rc[6].value; + + colsym[7].name = "active_color_2"; colsym[7].value = rc[7].value; - - colsym[8].name = "active_hilight_2"; + + colsym[8].name = "active_hilight_2"; colsym[8].value = rc[8].value; - - colsym[9].name = "active_shadow_2"; + + colsym[9].name = "active_shadow_2"; colsym[9].value = rc[9].value; - - colsym[10].name = "inactive_color_1"; - colsym[10].value = rc[10].value; - - colsym[11].name = "inactive_hilight_1"; - colsym[11].value = rc[11].value; - - colsym[12].name = "inactive_shadow_1"; - colsym[12].value = rc[12].value; - - colsym[13].name = "inactive_color_2"; + + colsym[10].name = "inactive_color_1"; + colsym[10].value = rc[10].value; + + colsym[11].name = "inactive_hilight_1"; + colsym[11].value = rc[11].value; + + colsym[12].name = "inactive_shadow_1"; + colsym[12].value = rc[12].value; + + colsym[13].name = "inactive_color_2"; colsym[13].value = rc[13].value; - - colsym[14].name = "inactive_hilight_2"; + + colsym[14].name = "inactive_hilight_2"; colsym[14].value = rc[14].value; - colsym[15].name = "inactive_shadow_2"; + colsym[15].name = "inactive_shadow_2"; colsym[15].value = rc[15].value; - - if (title_colors[ACTIVE].allocated) + + if(title_colors[ACTIVE].allocated) { - gdk_colormap_free_colors (gdk_colormap_get_system(),&title_colors[ACTIVE].col, 1); + gdk_colormap_free_colors(gdk_colormap_get_system(), &title_colors[ACTIVE].col, 1); title_colors[ACTIVE].allocated = FALSE; } - if (gdk_color_parse (rc[0].value, &title_colors[ACTIVE].col)) + if(gdk_color_parse(rc[0].value, &title_colors[ACTIVE].col)) { - if (gdk_colormap_alloc_color (gdk_colormap_get_system(), &title_colors[ACTIVE].col, FALSE, FALSE)) - { + if(gdk_colormap_alloc_color(gdk_colormap_get_system(), &title_colors[ACTIVE].col, FALSE, FALSE)) + { title_colors[ACTIVE].allocated = TRUE; - if (title_colors[ACTIVE].gc) - { - g_object_unref (G_OBJECT (title_colors[ACTIVE].gc)); - } - title_colors[ACTIVE].gc = gdk_gc_new (getDefaultGdkWindow()); - gdk_gc_copy (title_colors[ACTIVE].gc, get_style_gc (widget, "text", "selected")); - gdk_gc_set_foreground(title_colors[ACTIVE].gc, &title_colors[ACTIVE].col); - } - else - { - gdk_beep (); - g_message ("Cannot allocate active color %s\n", rc[0].value); - } + if(title_colors[ACTIVE].gc) + { + g_object_unref(G_OBJECT(title_colors[ACTIVE].gc)); + } + title_colors[ACTIVE].gc = gdk_gc_new(getDefaultGdkWindow()); + gdk_gc_copy(title_colors[ACTIVE].gc, get_style_gc(widget, "text", "selected")); + gdk_gc_set_foreground(title_colors[ACTIVE].gc, &title_colors[ACTIVE].col); + } + else + { + gdk_beep(); + g_message("Cannot allocate active color %s\n", rc[0].value); + } } else { - gdk_beep (); - g_message ("Cannot parse active color %s\n", rc[0].value); + gdk_beep(); + g_message("Cannot parse active color %s\n", rc[0].value); } - if (title_colors[INACTIVE].allocated) + if(title_colors[INACTIVE].allocated) { - gdk_colormap_free_colors (gdk_colormap_get_system(),&title_colors[INACTIVE].col, 1); + gdk_colormap_free_colors(gdk_colormap_get_system(), &title_colors[INACTIVE].col, 1); title_colors[INACTIVE].allocated = FALSE; } - if (gdk_color_parse (rc[1].value, &title_colors[INACTIVE].col)) + if(gdk_color_parse(rc[1].value, &title_colors[INACTIVE].col)) { - if (gdk_colormap_alloc_color (gdk_colormap_get_system(), &title_colors[INACTIVE].col, FALSE, FALSE)) - { + if(gdk_colormap_alloc_color(gdk_colormap_get_system(), &title_colors[INACTIVE].col, FALSE, FALSE)) + { title_colors[INACTIVE].allocated = TRUE; - if (title_colors[INACTIVE].gc) - { - g_object_unref (G_OBJECT (title_colors[INACTIVE].gc)); - } - title_colors[INACTIVE].gc = gdk_gc_new (getDefaultGdkWindow()); - gdk_gc_copy (title_colors[INACTIVE].gc, get_style_gc (widget, "text", "normal")); - gdk_gc_set_foreground(title_colors[INACTIVE].gc, &title_colors[INACTIVE].col); - } - else - { - gdk_beep (); - g_message ("Cannot allocate inactive color %s\n", rc[1].value); - } + if(title_colors[INACTIVE].gc) + { + g_object_unref(G_OBJECT(title_colors[INACTIVE].gc)); + } + title_colors[INACTIVE].gc = gdk_gc_new(getDefaultGdkWindow()); + gdk_gc_copy(title_colors[INACTIVE].gc, get_style_gc(widget, "text", "normal")); + gdk_gc_set_foreground(title_colors[INACTIVE].gc, &title_colors[INACTIVE].col); + } + else + { + gdk_beep(); + g_message("Cannot allocate inactive color %s\n", rc[1].value); + } } else { - gdk_beep (); - g_message ("Cannot parse inactive color %s\n", rc[1].value); + gdk_beep(); + g_message("Cannot parse inactive color %s\n", rc[1].value); } - loadPixmap(dpy, &sides[SIDE_LEFT][ACTIVE], theme, "left-active.xpm", colsym, 16); - loadPixmap(dpy, &sides[SIDE_LEFT][INACTIVE], theme, "left-inactive.xpm", colsym, 16); - loadPixmap(dpy, &sides[SIDE_RIGHT][ACTIVE], theme, "right-active.xpm", colsym, 16); - loadPixmap(dpy, &sides[SIDE_RIGHT][INACTIVE], theme, "right-inactive.xpm", colsym, 16); - loadPixmap(dpy, &sides[SIDE_BOTTOM][ACTIVE], theme, "bottom-active.xpm", colsym, 16); - loadPixmap(dpy, &sides[SIDE_BOTTOM][INACTIVE], theme, "bottom-inactive.xpm", colsym, 16); - loadPixmap(dpy, &corners[CORNER_TOP_LEFT][ACTIVE], theme, "top-left-active.xpm", colsym, 16); - loadPixmap(dpy, &corners[CORNER_TOP_LEFT][INACTIVE], theme, "top-left-inactive.xpm", colsym, 16); - loadPixmap(dpy, &corners[CORNER_TOP_RIGHT][ACTIVE], theme, "top-right-active.xpm", colsym, 16); - loadPixmap(dpy, &corners[CORNER_TOP_RIGHT][INACTIVE], theme, "top-right-inactive.xpm", colsym, 16); - loadPixmap(dpy, &corners[CORNER_BOTTOM_LEFT][ACTIVE], theme, "bottom-left-active.xpm", colsym, 16); - loadPixmap(dpy, &corners[CORNER_BOTTOM_LEFT][INACTIVE], theme, "bottom-left-inactive.xpm", colsym, 16); - loadPixmap(dpy, &corners[CORNER_BOTTOM_RIGHT][ACTIVE], theme, "bottom-right-active.xpm", colsym, 16); + loadPixmap(dpy, &sides[SIDE_LEFT][ACTIVE], theme, "left-active.xpm", colsym, 16); + loadPixmap(dpy, &sides[SIDE_LEFT][INACTIVE], theme, "left-inactive.xpm", colsym, 16); + loadPixmap(dpy, &sides[SIDE_RIGHT][ACTIVE], theme, "right-active.xpm", colsym, 16); + loadPixmap(dpy, &sides[SIDE_RIGHT][INACTIVE], theme, "right-inactive.xpm", colsym, 16); + loadPixmap(dpy, &sides[SIDE_BOTTOM][ACTIVE], theme, "bottom-active.xpm", colsym, 16); + loadPixmap(dpy, &sides[SIDE_BOTTOM][INACTIVE], theme, "bottom-inactive.xpm", colsym, 16); + loadPixmap(dpy, &corners[CORNER_TOP_LEFT][ACTIVE], theme, "top-left-active.xpm", colsym, 16); + loadPixmap(dpy, &corners[CORNER_TOP_LEFT][INACTIVE], theme, "top-left-inactive.xpm", colsym, 16); + loadPixmap(dpy, &corners[CORNER_TOP_RIGHT][ACTIVE], theme, "top-right-active.xpm", colsym, 16); + loadPixmap(dpy, &corners[CORNER_TOP_RIGHT][INACTIVE], theme, "top-right-inactive.xpm", colsym, 16); + loadPixmap(dpy, &corners[CORNER_BOTTOM_LEFT][ACTIVE], theme, "bottom-left-active.xpm", colsym, 16); + loadPixmap(dpy, &corners[CORNER_BOTTOM_LEFT][INACTIVE], theme, "bottom-left-inactive.xpm", colsym, 16); + loadPixmap(dpy, &corners[CORNER_BOTTOM_RIGHT][ACTIVE], theme, "bottom-right-active.xpm", colsym, 16); loadPixmap(dpy, &corners[CORNER_BOTTOM_RIGHT][INACTIVE], theme, "bottom-right-inactive.xpm", colsym, 16); - loadPixmap(dpy, &buttons[HIDE_BUTTON][ACTIVE], theme, "hide-active.xpm", colsym, 16); - loadPixmap(dpy, &buttons[HIDE_BUTTON][INACTIVE], theme, "hide-inactive.xpm", colsym, 16); - loadPixmap(dpy, &buttons[HIDE_BUTTON][PRESSED], theme, "hide-pressed.xpm", colsym, 16); - loadPixmap(dpy, &buttons[CLOSE_BUTTON][ACTIVE], theme, "close-active.xpm", colsym, 16); - loadPixmap(dpy, &buttons[CLOSE_BUTTON][INACTIVE], theme, "close-inactive.xpm", colsym, 16); - loadPixmap(dpy, &buttons[CLOSE_BUTTON][PRESSED], theme, "close-pressed.xpm", colsym, 16); - loadPixmap(dpy, &buttons[MAXIMIZE_BUTTON][ACTIVE], theme, "maximize-active.xpm", colsym, 16); - loadPixmap(dpy, &buttons[MAXIMIZE_BUTTON][INACTIVE], theme, "maximize-inactive.xpm", colsym, 16); - loadPixmap(dpy, &buttons[MAXIMIZE_BUTTON][PRESSED], theme, "maximize-pressed.xpm", colsym, 16); - loadPixmap(dpy, &buttons[SHADE_BUTTON][ACTIVE], theme, "shade-active.xpm", colsym, 16); - loadPixmap(dpy, &buttons[SHADE_BUTTON][INACTIVE], theme, "shade-inactive.xpm", colsym, 16); - loadPixmap(dpy, &buttons[SHADE_BUTTON][PRESSED], theme, "shade-pressed.xpm", colsym, 16); - loadPixmap(dpy, &buttons[STICK_BUTTON][ACTIVE], theme, "stick-active.xpm", colsym, 16); - loadPixmap(dpy, &buttons[STICK_BUTTON][INACTIVE], theme, "stick-inactive.xpm", colsym, 16); - loadPixmap(dpy, &buttons[STICK_BUTTON][PRESSED], theme, "stick-pressed.xpm", colsym, 16); - loadPixmap(dpy, &buttons[MENU_BUTTON][ACTIVE], theme, "menu-active.xpm", colsym, 16); - loadPixmap(dpy, &buttons[MENU_BUTTON][INACTIVE], theme, "menu-inactive.xpm", colsym, 16); - loadPixmap(dpy, &buttons[MENU_BUTTON][PRESSED], theme, "menu-pressed.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_1][ACTIVE], theme, "title-1-active.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_1][INACTIVE], theme, "title-1-inactive.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_2][ACTIVE], theme, "title-2-active.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_2][INACTIVE], theme, "title-2-inactive.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_3][ACTIVE], theme, "title-3-active.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_3][INACTIVE], theme, "title-3-inactive.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_4][ACTIVE], theme, "title-4-active.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_4][INACTIVE], theme, "title-4-inactive.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_5][ACTIVE], theme, "title-5-active.xpm", colsym, 16); - loadPixmap(dpy, &title[TITLE_5][INACTIVE], theme, "title-5-inactive.xpm", colsym, 16); + loadPixmap(dpy, &buttons[HIDE_BUTTON][ACTIVE], theme, "hide-active.xpm", colsym, 16); + loadPixmap(dpy, &buttons[HIDE_BUTTON][INACTIVE], theme, "hide-inactive.xpm", colsym, 16); + loadPixmap(dpy, &buttons[HIDE_BUTTON][PRESSED], theme, "hide-pressed.xpm", colsym, 16); + loadPixmap(dpy, &buttons[CLOSE_BUTTON][ACTIVE], theme, "close-active.xpm", colsym, 16); + loadPixmap(dpy, &buttons[CLOSE_BUTTON][INACTIVE], theme, "close-inactive.xpm", colsym, 16); + loadPixmap(dpy, &buttons[CLOSE_BUTTON][PRESSED], theme, "close-pressed.xpm", colsym, 16); + loadPixmap(dpy, &buttons[MAXIMIZE_BUTTON][ACTIVE], theme, "maximize-active.xpm", colsym, 16); + loadPixmap(dpy, &buttons[MAXIMIZE_BUTTON][INACTIVE], theme, "maximize-inactive.xpm", colsym, 16); + loadPixmap(dpy, &buttons[MAXIMIZE_BUTTON][PRESSED], theme, "maximize-pressed.xpm", colsym, 16); + loadPixmap(dpy, &buttons[SHADE_BUTTON][ACTIVE], theme, "shade-active.xpm", colsym, 16); + loadPixmap(dpy, &buttons[SHADE_BUTTON][INACTIVE], theme, "shade-inactive.xpm", colsym, 16); + loadPixmap(dpy, &buttons[SHADE_BUTTON][PRESSED], theme, "shade-pressed.xpm", colsym, 16); + loadPixmap(dpy, &buttons[STICK_BUTTON][ACTIVE], theme, "stick-active.xpm", colsym, 16); + loadPixmap(dpy, &buttons[STICK_BUTTON][INACTIVE], theme, "stick-inactive.xpm", colsym, 16); + loadPixmap(dpy, &buttons[STICK_BUTTON][PRESSED], theme, "stick-pressed.xpm", colsym, 16); + loadPixmap(dpy, &buttons[MENU_BUTTON][ACTIVE], theme, "menu-active.xpm", colsym, 16); + loadPixmap(dpy, &buttons[MENU_BUTTON][INACTIVE], theme, "menu-inactive.xpm", colsym, 16); + loadPixmap(dpy, &buttons[MENU_BUTTON][PRESSED], theme, "menu-pressed.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_1][ACTIVE], theme, "title-1-active.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_1][INACTIVE], theme, "title-1-inactive.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_2][ACTIVE], theme, "title-2-active.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_2][INACTIVE], theme, "title-2-inactive.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_3][ACTIVE], theme, "title-3-active.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_3][INACTIVE], theme, "title-3-inactive.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_4][ACTIVE], theme, "title-4-active.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_4][INACTIVE], theme, "title-4-inactive.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_5][ACTIVE], theme, "title-5-active.xpm", colsym, 16); + loadPixmap(dpy, &title[TITLE_5][INACTIVE], theme, "title-5-inactive.xpm", colsym, 16); if(!g_strcasecmp("left", getValue("title_alignment", rc))) { @@ -390,52 +390,52 @@ void loadSettings() unsigned long data[1]; workspace_count = abs(atoi(getValue("workspace_count", rc))); setGnomeHint(dpy, root, win_workspace_count, workspace_count); - data[0] = workspace_count; - XChangeProperty (dpy, root, net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 1); + data[0] = workspace_count; + XChangeProperty(dpy, root, net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); } - wrap_workspaces = !g_strcasecmp("true", getValue("wrap_workspaces", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_UP], getValue("move_window_up_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_DOWN], getValue("move_window_down_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_LEFT], getValue("move_window_left_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_RIGHT], getValue("move_window_right_key", rc)); - parseKeyString(dpy, &keys[KEY_RESIZE_UP], getValue("resize_window_up_key", rc)); - parseKeyString(dpy, &keys[KEY_RESIZE_DOWN], getValue("resize_window_down_key", rc)); - parseKeyString(dpy, &keys[KEY_RESIZE_LEFT], getValue("resize_window_left_key", rc)); - parseKeyString(dpy, &keys[KEY_RESIZE_RIGHT], getValue("resize_window_right_key", rc)); - parseKeyString(dpy, &keys[KEY_CYCLE_WINDOWS], getValue("cycle_windows_key", rc)); - parseKeyString(dpy, &keys[KEY_CLOSE_WINDOW], getValue("close_window_key", rc)); - parseKeyString(dpy, &keys[KEY_HIDE_WINDOW], getValue("hide_window_key", rc)); - parseKeyString(dpy, &keys[KEY_MAXIMIZE_WINDOW], getValue("maximize_window_key", rc)); - parseKeyString(dpy, &keys[KEY_MAXIMIZE_VERT], getValue("maximize_vert_key", rc)); - parseKeyString(dpy, &keys[KEY_MAXIMIZE_HORIZ], getValue("maximize_horiz_key", rc)); - parseKeyString(dpy, &keys[KEY_SHADE_WINDOW], getValue("shade_window_key", rc)); - parseKeyString(dpy, &keys[KEY_LOWER_WINDOW_LAYER], getValue("lower_window_layer_key", rc)); - parseKeyString(dpy, &keys[KEY_RAISE_WINDOW_LAYER], getValue("raise_window_layer_key", rc)); - parseKeyString(dpy, &keys[KEY_NEXT_WORKSPACE], getValue("next_workspace_key", rc)); - parseKeyString(dpy, &keys[KEY_PREV_WORKSPACE], getValue("prev_workspace_key", rc)); - parseKeyString(dpy, &keys[KEY_ADD_WORKSPACE], getValue("add_workspace_key", rc)); - parseKeyString(dpy, &keys[KEY_DEL_WORKSPACE], getValue("del_workspace_key", rc)); - parseKeyString(dpy, &keys[KEY_STICK_WINDOW], getValue("stick_window_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_1], getValue("workspace_1_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_2], getValue("workspace_2_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_3], getValue("workspace_3_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_4], getValue("workspace_4_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_5], getValue("workspace_5_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_6], getValue("workspace_6_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_7], getValue("workspace_7_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_8], getValue("workspace_8_key", rc)); - parseKeyString(dpy, &keys[KEY_WORKSPACE_9], getValue("workspace_9_key", rc)); + wrap_workspaces = !g_strcasecmp("true", getValue("wrap_workspaces", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_UP], getValue("move_window_up_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_DOWN], getValue("move_window_down_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_LEFT], getValue("move_window_left_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_RIGHT], getValue("move_window_right_key", rc)); + parseKeyString(dpy, &keys[KEY_RESIZE_UP], getValue("resize_window_up_key", rc)); + parseKeyString(dpy, &keys[KEY_RESIZE_DOWN], getValue("resize_window_down_key", rc)); + parseKeyString(dpy, &keys[KEY_RESIZE_LEFT], getValue("resize_window_left_key", rc)); + parseKeyString(dpy, &keys[KEY_RESIZE_RIGHT], getValue("resize_window_right_key", rc)); + parseKeyString(dpy, &keys[KEY_CYCLE_WINDOWS], getValue("cycle_windows_key", rc)); + parseKeyString(dpy, &keys[KEY_CLOSE_WINDOW], getValue("close_window_key", rc)); + parseKeyString(dpy, &keys[KEY_HIDE_WINDOW], getValue("hide_window_key", rc)); + parseKeyString(dpy, &keys[KEY_MAXIMIZE_WINDOW], getValue("maximize_window_key", rc)); + parseKeyString(dpy, &keys[KEY_MAXIMIZE_VERT], getValue("maximize_vert_key", rc)); + parseKeyString(dpy, &keys[KEY_MAXIMIZE_HORIZ], getValue("maximize_horiz_key", rc)); + parseKeyString(dpy, &keys[KEY_SHADE_WINDOW], getValue("shade_window_key", rc)); + parseKeyString(dpy, &keys[KEY_LOWER_WINDOW_LAYER], getValue("lower_window_layer_key", rc)); + parseKeyString(dpy, &keys[KEY_RAISE_WINDOW_LAYER], getValue("raise_window_layer_key", rc)); + parseKeyString(dpy, &keys[KEY_NEXT_WORKSPACE], getValue("next_workspace_key", rc)); + parseKeyString(dpy, &keys[KEY_PREV_WORKSPACE], getValue("prev_workspace_key", rc)); + parseKeyString(dpy, &keys[KEY_ADD_WORKSPACE], getValue("add_workspace_key", rc)); + parseKeyString(dpy, &keys[KEY_DEL_WORKSPACE], getValue("del_workspace_key", rc)); + parseKeyString(dpy, &keys[KEY_STICK_WINDOW], getValue("stick_window_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_1], getValue("workspace_1_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_2], getValue("workspace_2_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_3], getValue("workspace_3_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_4], getValue("workspace_4_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_5], getValue("workspace_5_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_6], getValue("workspace_6_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_7], getValue("workspace_7_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_8], getValue("workspace_8_key", rc)); + parseKeyString(dpy, &keys[KEY_WORKSPACE_9], getValue("workspace_9_key", rc)); parseKeyString(dpy, &keys[KEY_MOVE_NEXT_WORKSPACE], getValue("move_window_next_workspace_key", rc)); parseKeyString(dpy, &keys[KEY_MOVE_PREV_WORKSPACE], getValue("move_window_prev_workspace_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_1], getValue("move_window_workspace_1_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_2], getValue("move_window_workspace_2_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_3], getValue("move_window_workspace_3_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_4], getValue("move_window_workspace_4_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_5], getValue("move_window_workspace_5_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_6], getValue("move_window_workspace_6_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_7], getValue("move_window_workspace_7_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_8], getValue("move_window_workspace_8_key", rc)); - parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_9], getValue("move_window_workspace_9_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_1], getValue("move_window_workspace_1_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_2], getValue("move_window_workspace_2_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_3], getValue("move_window_workspace_3_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_4], getValue("move_window_workspace_4_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_5], getValue("move_window_workspace_5_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_6], getValue("move_window_workspace_6_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_7], getValue("move_window_workspace_7_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_8], getValue("move_window_workspace_8_key", rc)); + parseKeyString(dpy, &keys[KEY_MOVE_WORKSPACE_9], getValue("move_window_workspace_9_key", rc)); ungrabKeys(dpy, gnome_win); grabKey(dpy, &keys[KEY_CYCLE_WINDOWS], gnome_win); grabKey(dpy, &keys[KEY_NEXT_WORKSPACE], gnome_win); @@ -504,7 +504,7 @@ void reloadSettings() } } -void initSettings (void) +void initSettings(void) { title_colors[ACTIVE].gc = NULL; title_colors[ACTIVE].allocated = FALSE; diff --git a/src/settings.h b/src/settings.h index cdc477092..b201a0762 100644 --- a/src/settings.h +++ b/src/settings.h @@ -32,9 +32,9 @@ typedef struct _MyColor MyColor; struct _MyColor { - GdkColor col; - GdkGC *gc; - gboolean allocated; + GdkColor col; + GdkGC *gc; + gboolean allocated; }; extern MyKey keys[KEY_COUNT]; @@ -64,6 +64,6 @@ extern MyPixmap title[5][2]; void loadSettings(void); void unloadSettings(void); void reloadSettings(void); -void initSettings (void); +void initSettings(void); #endif /* __SETTINGS_H__ */ diff --git a/src/workspaces.c b/src/workspaces.c index a598c5b1d..e5481a4b1 100644 --- a/src/workspaces.c +++ b/src/workspaces.c @@ -63,65 +63,65 @@ void workspaceSwitch(int new_ws, Client * c2) { f->focus = True; } - + if(c2) { setGnomeHint(dpy, c2->window, win_workspace, new_ws); data[0] = new_ws; - XChangeProperty (dpy, c2->window, net_wm_desktop, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 1); + XChangeProperty(dpy, c2->window, net_wm_desktop, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); c2->win_workspace = new_ws; } setGnomeHint(dpy, root, win_workspace, new_ws); data[0] = new_ws; - XChangeProperty (dpy, root, net_current_desktop, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 1); + XChangeProperty(dpy, root, net_current_desktop, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); workspace = new_ws; - + /* Do the switch in two passes : - The first one, unmapping windows from bottom to top - The second pass, mapping from top to bottom - + ==> this save a lot of expose events and make things a lot faster ;-) */ - + /* First pass */ for(last = clients, i = 0; i < client_count; last = last->next, i++); for(c = last, i = 0; i < client_count; c = c->prev, i++) { if((c->visible) && !(c->sticky) && ((c->win_workspace != new_ws))) - { + { clientHide(c, False); - } + } } /* Second pass */ for(c = clients, i = 0; i < client_count; c = c->next, i++) { if(c->sticky) - { + { clientSetWorkspace(c, new_ws); } - else + else { if((c->win_workspace == new_ws) && !(c->hidden)) { clientShow(c, False); if(c->focus) - { + { f = c; } - c->focus = False; + c->focus = False; } } } if(c2) { f = c2; - clientRaise (c2); + clientRaise(c2); } workspaceUpdateArea(margins, gnome_margins); clientSetFocus(f, True); - XSync (dpy, 0); + XSync(dpy, 0); } void workspaceSetCount(int count) @@ -143,52 +143,52 @@ void workspaceSetCount(int count) setGnomeHint(dpy, root, win_workspace_count, count); data[0] = count; - XChangeProperty (dpy, root, net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 1); + XChangeProperty(dpy, root, net_number_of_desktops, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); 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); - } + } } if(workspace > count - 1) { workspaceSwitch(count - 1, NULL); } - set_net_workarea (dpy, root, workspace_count, margins); + set_net_workarea(dpy, root, workspace_count, margins); } -void workspaceUpdateArea(CARD32 *margins, CARD32 *gnome_margins) +void workspaceUpdateArea(CARD32 * margins, CARD32 * gnome_margins) { Client *c; int i; - int prev_top = margins[MARGIN_TOP]; - int prev_left = margins[MARGIN_LEFT]; - int prev_right = margins[MARGIN_RIGHT]; + int prev_top = margins[MARGIN_TOP]; + int prev_left = margins[MARGIN_LEFT]; + int prev_right = margins[MARGIN_RIGHT]; int prev_bottom = margins[MARGIN_BOTTOM]; DBG("entering workspaceSetCount\n"); - for (i = 0; i < 4; i++) + for(i = 0; i < 4; i++) { margins[i] = gnome_margins[i]; } for(c = clients, i = 0; i < client_count; c = c->next, i++) { if((c->has_struts) && (c->visible)) - { - margins[MARGIN_TOP] = MAX(margins[MARGIN_TOP], c->struts[MARGIN_TOP]); - margins[MARGIN_LEFT] = MAX(margins[MARGIN_LEFT], c->struts[MARGIN_LEFT]); - margins[MARGIN_RIGHT] = MAX(margins[MARGIN_RIGHT], c->struts[MARGIN_RIGHT]); - margins[MARGIN_BOTTOM] = MAX(margins[MARGIN_BOTTOM], c->struts[MARGIN_BOTTOM]); - } + { + margins[MARGIN_TOP] = MAX(margins[MARGIN_TOP], c->struts[MARGIN_TOP]); + margins[MARGIN_LEFT] = MAX(margins[MARGIN_LEFT], c->struts[MARGIN_LEFT]); + margins[MARGIN_RIGHT] = MAX(margins[MARGIN_RIGHT], c->struts[MARGIN_RIGHT]); + margins[MARGIN_BOTTOM] = MAX(margins[MARGIN_BOTTOM], c->struts[MARGIN_BOTTOM]); + } } DBG("Desktop area computed : (%d,%d,%d,%d)\n", margins[0], margins[1], margins[2], margins[3]); - if ((prev_top != margins[MARGIN_TOP]) || (prev_left != margins[MARGIN_LEFT]) || (prev_right != margins[MARGIN_RIGHT]) || (prev_bottom != margins[MARGIN_BOTTOM])) + if((prev_top != margins[MARGIN_TOP]) || (prev_left != margins[MARGIN_LEFT]) || (prev_right != margins[MARGIN_RIGHT]) || (prev_bottom != margins[MARGIN_BOTTOM])) { DBG("Margins have changed, updating net_workarea\n"); - set_net_workarea (dpy, root, workspace_count, margins); + set_net_workarea(dpy, root, workspace_count, margins); } } diff --git a/src/workspaces.h b/src/workspaces.h index bf72b059a..01bd61c1b 100644 --- a/src/workspaces.h +++ b/src/workspaces.h @@ -36,6 +36,6 @@ extern int workspace; void workspaceSwitch(int, Client *); void workspaceSetCount(int); -void workspaceUpdateArea(CARD32*, CARD32*); +void workspaceUpdateArea(CARD32 *, CARD32 *); #endif /* __WORKSPACES_H__ */ diff --git a/themes/Makefile.in b/themes/Makefile.in index 85ccfaea5..faeb14158 100644 --- a/themes/Makefile.in +++ b/themes/Makefile.in @@ -63,23 +63,7 @@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ -SUBDIRS = \ -agua \ -coldsteel \ -crux \ -cruxish \ -gtk \ -kde \ -linea \ -mofit \ -next \ -oroborus \ -platinum \ -redmond \ -redmondxp \ -slimline \ -trench \ -xfce +SUBDIRS = agua coldsteel crux cruxish gtk kde linea mofit next oroborus platinum redmond redmondxp slimline trench xfce mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h diff --git a/themes/agua/Makefile.in b/themes/agua/Makefile.in index 7e5c9679b..2e7e7956f 100644 --- a/themes/agua/Makefile.in +++ b/themes/agua/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/agua -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/coldsteel/Makefile.in b/themes/coldsteel/Makefile.in index b4d1d5ca6..c75db2aaf 100644 --- a/themes/coldsteel/Makefile.in +++ b/themes/coldsteel/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/coldsteel -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/crux/Makefile.in b/themes/crux/Makefile.in index 75833077f..9b7ee8a7b 100644 --- a/themes/crux/Makefile.in +++ b/themes/crux/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/crux -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/cruxish/Makefile.in b/themes/cruxish/Makefile.in index ac9ea42a5..5c94fa4e1 100644 --- a/themes/cruxish/Makefile.in +++ b/themes/cruxish/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/cruxish -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/gtk/Makefile.in b/themes/gtk/Makefile.in index e1b0f064a..6aa74fe13 100644 --- a/themes/gtk/Makefile.in +++ b/themes/gtk/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/gtk -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/kde/Makefile.in b/themes/kde/Makefile.in index 94534a19b..46cb285af 100644 --- a/themes/kde/Makefile.in +++ b/themes/kde/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/kde -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/linea/Makefile.in b/themes/linea/Makefile.in index 002d780ba..ce159dce0 100644 --- a/themes/linea/Makefile.in +++ b/themes/linea/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/linea -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/mofit/Makefile.in b/themes/mofit/Makefile.in index 0d353503c..e0ad590ec 100644 --- a/themes/mofit/Makefile.in +++ b/themes/mofit/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/mofit -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/next/Makefile.in b/themes/next/Makefile.in index 73b585e12..326ce1841 100644 --- a/themes/next/Makefile.in +++ b/themes/next/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/next -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/oroborus/Makefile.in b/themes/oroborus/Makefile.in index 1e43687b5..7dbabc66d 100644 --- a/themes/oroborus/Makefile.in +++ b/themes/oroborus/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/oroborus -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/platinum/Makefile.in b/themes/platinum/Makefile.in index 7aac26242..a62f61763 100644 --- a/themes/platinum/Makefile.in +++ b/themes/platinum/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/platinum -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/redmond/Makefile.in b/themes/redmond/Makefile.in index 83f178b4b..0d8f6bc01 100644 --- a/themes/redmond/Makefile.in +++ b/themes/redmond/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/redmond -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/redmondxp/Makefile.in b/themes/redmondxp/Makefile.in index 84e8663d3..dc42cea80 100644 --- a/themes/redmondxp/Makefile.in +++ b/themes/redmondxp/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/redmondxp -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/slimline/Makefile.in b/themes/slimline/Makefile.in index 88e3ca71f..b63f8a177 100644 --- a/themes/slimline/Makefile.in +++ b/themes/slimline/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/slimline -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/trench/Makefile.in b/themes/trench/Makefile.in index 56ce96d7f..be30a0f9e 100644 --- a/themes/trench/Makefile.in +++ b/themes/trench/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/trench -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/themes/xfce/Makefile.in b/themes/xfce/Makefile.in index ffba6e56c..95dcce298 100644 --- a/themes/xfce/Makefile.in +++ b/themes/xfce/Makefile.in @@ -64,49 +64,7 @@ PKG_CONFIG = @PKG_CONFIG@ VERSION = @VERSION@ themedir = $(pkgdatadir)/themes/xfce -theme_DATA = bottom-active.xpm \ - bottom-inactive.xpm \ - bottom-left-active.xpm \ - bottom-left-inactive.xpm \ - bottom-right-active.xpm \ - bottom-right-inactive.xpm \ - close-active.xpm \ - close-inactive.xpm \ - close-pressed.xpm \ - hide-active.xpm \ - hide-inactive.xpm \ - hide-pressed.xpm \ - left-active.xpm \ - left-inactive.xpm \ - maximize-active.xpm \ - maximize-inactive.xpm \ - maximize-pressed.xpm \ - menu-active.xpm \ - menu-inactive.xpm \ - menu-pressed.xpm \ - right-active.xpm \ - right-inactive.xpm \ - shade-active.xpm \ - shade-inactive.xpm \ - shade-pressed.xpm \ - stick-active.xpm \ - stick-inactive.xpm \ - stick-pressed.xpm \ - themerc \ - title-1-active.xpm \ - title-1-inactive.xpm \ - title-2-active.xpm \ - title-2-inactive.xpm \ - title-3-active.xpm \ - title-3-inactive.xpm \ - title-4-active.xpm \ - title-4-inactive.xpm \ - title-5-active.xpm \ - title-5-inactive.xpm \ - top-left-active.xpm \ - top-left-inactive.xpm \ - top-right-active.xpm \ - top-right-inactive.xpm +theme_DATA = bottom-active.xpm bottom-inactive.xpm bottom-left-active.xpm bottom-left-inactive.xpm bottom-right-active.xpm bottom-right-inactive.xpm close-active.xpm close-inactive.xpm close-pressed.xpm hide-active.xpm hide-inactive.xpm hide-pressed.xpm left-active.xpm left-inactive.xpm maximize-active.xpm maximize-inactive.xpm maximize-pressed.xpm menu-active.xpm menu-inactive.xpm menu-pressed.xpm right-active.xpm right-inactive.xpm shade-active.xpm shade-inactive.xpm shade-pressed.xpm stick-active.xpm stick-inactive.xpm stick-pressed.xpm themerc title-1-active.xpm title-1-inactive.xpm title-2-active.xpm title-2-inactive.xpm title-3-active.xpm title-3-inactive.xpm title-4-active.xpm title-4-inactive.xpm title-5-active.xpm title-5-inactive.xpm top-left-active.xpm top-left-inactive.xpm top-right-active.xpm top-right-inactive.xpm EXTRA_DIST = $(theme_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |