summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-04-24 01:29:53 +0000
committerDana Jansens <danakj@orodu.net>2007-04-24 01:29:53 +0000
commit7ae95e46606a1fa22e302fd2c1ea99cb23acbd81 (patch)
tree78c8d149eb8e981e06408206347f9b5fb624e03b /openbox/client.c
parent3595da62ca70f494f3341af744da627af414cb18 (diff)
save windows' colormaps rather than querying them from the server every time you focus it
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 08d316c4..4dad9882 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -49,7 +49,8 @@
#include <X11/Xutil.h>
/*! The event mask to grab on client windows */
-#define CLIENT_EVENTMASK (PropertyChangeMask | StructureNotifyMask)
+#define CLIENT_EVENTMASK (PropertyChangeMask | StructureNotifyMask | \
+ ColormapChangeMask)
#define CLIENT_NOPROPAGATEMASK (ButtonPressMask | ButtonReleaseMask | \
ButtonMotionMask)
@@ -75,6 +76,7 @@ static void client_get_shaped(ObClient *self);
static void client_get_mwm_hints(ObClient *self);
static void client_get_gravity(ObClient *self);
static void client_get_client_machine(ObClient *self);
+static void client_get_colormap(ObClient *self);
static void client_change_allowed_actions(ObClient *self);
static void client_change_state(ObClient *self);
static void client_change_wm_state(ObClient *self);
@@ -939,6 +941,7 @@ static void client_get_all(ObClient *self)
client_setup_decor_and_functions(self);
client_get_client_machine(self);
+ client_get_colormap(self);
client_update_title(self);
client_update_class(self);
client_update_sm_client_id(self);
@@ -1310,6 +1313,19 @@ static void client_get_gravity(ObClient *self)
self->gravity = wattrib.win_gravity;
}
+void client_get_colormap(ObClient *self)
+{
+ XWindowAttributes wa;
+
+ if (XGetWindowAttributes(ob_display, self->window, &wa))
+ client_update_colormap(self, wa.colormap);
+}
+
+void client_update_colormap(ObClient *self, Colormap colormap)
+{
+ self->colormap = colormap;
+}
+
void client_update_normal_hints(ObClient *self)
{
XSizeHints size;