#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)
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);
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);
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;
/*! Window decoration and functionality hints */
ObMwmHints mwmhints;
+
+ /*! The client's specified colormap */
+ Colormap colormap;
/*! Where to place the decorated window in relation to the undecorated
window */
/*! Update the protocols that the window supports and adjusts things if they
change */
void client_update_protocols(ObClient *self);
+/*! Updates the window's colormap */
+void client_update_colormap(ObClient *self, Colormap colormap);
/*! Updates the WMNormalHints and adjusts things if they change */
void client_update_normal_hints(ObClient *self);
else if (msgtype == prop_atoms.sm_client_id) {
client_update_sm_client_id(client);
}
+ case ColormapNotify:
+ client_update_colormap(client, e->xcolormap.colormap);
+ break;
default:
;
#ifdef SHAPE
void screen_install_colormap(ObClient *client, gboolean install)
{
- XWindowAttributes wa;
-
if (client == NULL) {
if (install)
XInstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
else
XUninstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
} else {
- if (XGetWindowAttributes(ob_display, client->window, &wa) &&
- wa.colormap != None) {
- xerror_set_ignore(TRUE);
- if (install)
- XInstallColormap(RrDisplay(ob_rr_inst), wa.colormap);
- else
- XUninstallColormap(RrDisplay(ob_rr_inst), wa.colormap);
- xerror_set_ignore(FALSE);
- }
+ xerror_set_ignore(TRUE);
+ if (install) {
+ if (client->colormap != None)
+ XInstallColormap(RrDisplay(ob_rr_inst), client->colormap);
+ } else
+ XUninstallColormap(RrDisplay(ob_rr_inst), client->colormap);
+ xerror_set_ignore(FALSE);
}
}