From: Benoit Gschwind Date: Wed, 20 Feb 2008 22:28:16 +0000 (+0100) Subject: Rename ObCLient.window to ObClient.w_client X-Git-Tag: plugin~19 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=43552a29601856733b22c1a70ad4ca1ee80b18fc;p=dana%2Fopenbox.git Rename ObCLient.window to ObClient.w_client --- diff --git a/engines/default/plugin.c b/engines/default/plugin.c index 794e3733..46275401 100644 --- a/engines/default/plugin.c +++ b/engines/default/plugin.c @@ -75,7 +75,7 @@ Visual *check_32bit_client(ObClient *c) if (RrDepth(ob_rr_inst) == 32) return NULL; - ret = XGetWindowAttributes(obp_display, c->window, &wattrib); + ret = XGetWindowAttributes(obp_display, c->w_client, &wattrib); g_assert(ret != BadDrawable); g_assert(ret != BadWindow); @@ -94,7 +94,7 @@ gint init(Display * display, gint screen) obp_screen = screen; } -gpointer frame_new(struct _ObClient * client) +gpointer frame_new(struct _ObClient * client, Window w_client, Window w_frame) { XSetWindowAttributes attrib; gulong mask; @@ -114,15 +114,13 @@ gpointer frame_new(struct _ObClient * client) mask |= CWColormap | CWBackPixel | CWBorderPixel; /* create a colormap with the visual */ OBDEFAULTFRAME(self)->colormap = attrib.colormap = XCreateColormap( - obp_display, RootWindow(obp_display, - obp_screen), visual, AllocNone); - attrib.background_pixel = BlackPixel(obp_display, - obp_screen); + obp_display, RootWindow(obp_display, obp_screen), visual, + AllocNone); + attrib.background_pixel = BlackPixel(obp_display, obp_screen); attrib.border_pixel = BlackPixel(obp_display, obp_screen); } - self->window = createWindow( - RootWindow(obp_display, obp_screen), visual, mask, - &attrib); + self->window = createWindow(RootWindow(obp_display, obp_screen), visual, + mask, &attrib); /* create the visible decor windows */ @@ -225,10 +223,10 @@ void set_theme_statics(gpointer _self) theme_config.paddingy + 1); XResizeWindow(obp_display, self->trtresize, theme_config.grip_width, theme_config.paddingy + 1); - XResizeWindow(obp_display, self->tllresize, - theme_config.paddingx + 1, theme_config.title_height); - XResizeWindow(obp_display, self->trrresize, - theme_config.paddingx + 1, theme_config.title_height); + XResizeWindow(obp_display, self->tllresize, theme_config.paddingx + 1, + theme_config.title_height); + XResizeWindow(obp_display, self->trrresize, theme_config.paddingx + 1, + theme_config.title_height); /* set up the dynamic appearances */ self->a_unfocused_title = RrAppearanceCopy(theme_config.a_unfocused_title); @@ -259,7 +257,7 @@ void frame_free(gpointer self) XDestroyWindow(obp_display, OBDEFAULTFRAME(self)->window); if (OBDEFAULTFRAME(self)->colormap) XFreeColormap(obp_display, OBDEFAULTFRAME(self)->colormap); - + g_free(OBDEFAULTFRAME(self)->stitle); g_free(self); } @@ -274,7 +272,7 @@ void frame_show(gpointer _self) the client gets its MapNotify, i.e. to make sure the client is _visible_ when it gets MapNotify. */ grab_server(TRUE); - XMapWindow(obp_display, self->client->window); + XMapWindow(obp_display, self->client->w_client); XMapWindow(obp_display, self->window); grab_server(FALSE); } @@ -288,7 +286,7 @@ gint frame_hide(gpointer self) XUnmapWindow(obp_display, OBDEFAULTFRAME(self)->window); /* we unmap the client itself so that we can get MapRequest events, and because the ICCCM tells us to! */ - XUnmapWindow(obp_display, OBDEFAULTFRAME(self)->client->window); + XUnmapWindow(obp_display, OBDEFAULTFRAME(self)->client->w_client); return 1; } else { @@ -323,7 +321,7 @@ void frame_adjust_shape(gpointer _self) XShapeCombineShape(obp_display, self->window, ShapeBounding, self->size.left, self->size.top, - self->client->window, + self->client->w_client, ShapeBounding, ShapeSet); num = 0; @@ -363,7 +361,7 @@ void frame_grab(gpointer _self, GHashTable * window_map) */ /* reparent the client to the frame */ - XReparentWindow(obp_display, self->client->window, self->window, 0, 0); + XReparentWindow(obp_display, self->client->w_client, self->window, 0, 0); /* When reparenting the client window, it is usually not mapped yet, since @@ -433,7 +431,7 @@ void frame_ungrab(gpointer _self, GHashTable * window_map) frame_animate_iconify, self, FALSE); /* check if the app has already reparented its window away */ - while (XCheckTypedWindowEvent(obp_display, self->client->window, + while (XCheckTypedWindowEvent(obp_display, self->client->w_client, ReparentNotify, &ev)) { /* This check makes sure we don't catch our own reparent action to our frame window. This doesn't count as the app reparenting itself @@ -452,7 +450,7 @@ void frame_ungrab(gpointer _self, GHashTable * window_map) if (reparent) { /* according to the ICCCM - if the client doesn't reparent itself, then we will reparent the window to root for them */ - XReparentWindow(obp_display, self->client->window, RootWindow( + XReparentWindow(obp_display, self->client->w_client, RootWindow( obp_display, obp_screen), self->client_area.x, self->client_area.y); } @@ -772,8 +770,8 @@ void frame_end_iconify_animation(gpointer _self) /* we're not animating any more ! */ self->iconify_animation_going = 0; - XMoveResizeWindow(obp_display, self->window, self->area.x, - self->area.y, self->area.width, self->area.height); + XMoveResizeWindow(obp_display, self->window, self->area.x, self->area.y, + self->area.width, self->area.height); /* we delay re-rendering until after we're done animating */ frame_update_skin(self); XFlush(obp_display); @@ -866,9 +864,9 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) gint innercornerheight = theme_config.grip_width - self->size.bottom; if (self->cbwidth_l) { - XMoveResizeWindow(obp_display, self->innerleft, - self->size.left - self->cbwidth_l, self->size.top, - self->cbwidth_l, self->client_area.height); + XMoveResizeWindow(obp_display, self->innerleft, self->size.left + - self->cbwidth_l, self->size.top, self->cbwidth_l, + self->client_area.height); XMapWindow(obp_display, self->innerleft); } @@ -887,9 +885,9 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) XUnmapWindow(obp_display, self->innerbll); if (self->cbwidth_r) { - XMoveResizeWindow(obp_display, self->innerright, - self->size.left + self->client_area.width, self->size.top, - self->cbwidth_r, self->client_area.height); + XMoveResizeWindow(obp_display, self->innerright, self->size.left + + self->client_area.width, self->size.top, self->cbwidth_r, + self->client_area.height); XMapWindow(obp_display, self->innerright); } @@ -908,10 +906,12 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) XUnmapWindow(obp_display, self->innerbrr); if (self->cbwidth_t) { - XMoveResizeWindow(obp_display, self->innertop, - self->size.left - self->cbwidth_l, self->size.top - - self->cbwidth_t, self->client_area.width - + self->cbwidth_l + self->cbwidth_r, + XMoveResizeWindow( + obp_display, + self->innertop, + self->size.left - self->cbwidth_l, + self->size.top - self->cbwidth_t, + self->client_area.width + self->cbwidth_l + self->cbwidth_r, self->cbwidth_t); XMapWindow(obp_display, self->innertop); @@ -920,11 +920,10 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) XUnmapWindow(obp_display, self->innertop); if (self->cbwidth_b) { - XMoveResizeWindow(obp_display, self->innerbottom, - self->size.left - self->cbwidth_l, self->size.top - + self->client_area.height, self->client_area.width - + self->cbwidth_l + self->cbwidth_r, - self->cbwidth_b); + XMoveResizeWindow(obp_display, self->innerbottom, self->size.left + - self->cbwidth_l, self->size.top + + self->client_area.height, self->client_area.width + + self->cbwidth_l + self->cbwidth_r, self->cbwidth_b); XMoveResizeWindow(obp_display, self->innerblb, 0, 0, theme_config.grip_width + self->bwidth, self->cbwidth_b); @@ -1003,9 +1002,9 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) } if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { - XMoveResizeWindow(obp_display, self->title, - (self->max_horz ? 0 : self->bwidth), self->bwidth, - self->width, theme_config.title_height); + XMoveResizeWindow(obp_display, self->title, (self->max_horz ? 0 + : self->bwidth), self->bwidth, self->width, + theme_config.title_height); XMapWindow(obp_display, self->title); @@ -1087,13 +1086,12 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) self->size.top + self->client_area.height + self->size.bottom - self->bwidth, theme_config.grip_width + self->bwidth, self->bwidth); - XMoveResizeWindow(obp_display, self->rgripbottom, - self->size.left + self->client_area.width - + self->size.right - self->bwidth - sidebwidth - - theme_config.grip_width, self->size.top - + self->client_area.height + self->size.bottom - - self->bwidth, theme_config.grip_width - + self->bwidth, self->bwidth); + XMoveResizeWindow(obp_display, self->rgripbottom, self->size.left + + self->client_area.width + self->size.right - self->bwidth + - sidebwidth - theme_config.grip_width, self->size.top + + self->client_area.height + self->size.bottom + - self->bwidth, theme_config.grip_width + self->bwidth, + self->bwidth); XMapWindow(obp_display, self->handlebottom); XMapWindow(obp_display, self->lgripbottom); @@ -1116,10 +1114,9 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) - self->bwidth, 0, self->bwidth, theme_config.handle_height); - XMoveResizeWindow(obp_display, self->lgriptop, - sidebwidth, - FRAME_HANDLE_Y(self), theme_config.grip_width - + self->bwidth, self->bwidth); + XMoveResizeWindow(obp_display, self->lgriptop, sidebwidth, + FRAME_HANDLE_Y(self), theme_config.grip_width + self->bwidth, + self->bwidth); XMoveResizeWindow(obp_display, self->rgriptop, self->size.left + self->client_area.width + self->size.right - self->bwidth @@ -1208,10 +1205,9 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) if (self->bwidth && !self->max_horz && (self->client_area.height + self->size.top + self->size.bottom) > theme_config.grip_width * 2) { - XMoveResizeWindow(obp_display, self->right, - self->client_area.width + self->cbwidth_l + self->cbwidth_r - + self->bwidth, self->bwidth - + theme_config.grip_width, self->bwidth, + XMoveResizeWindow(obp_display, self->right, self->client_area.width + + self->cbwidth_l + self->cbwidth_r + self->bwidth, + self->bwidth + theme_config.grip_width, self->bwidth, self->client_area.height + self->size.top + self->size.bottom - theme_config.grip_width * 2); @@ -1255,7 +1251,7 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) this also needs to be run when the frame's decorations sizes change! */ if (!is_resize) - XMoveResizeWindow(obp_display, self->client->window, + XMoveResizeWindow(obp_display, self->client->w_client, self->size.left, self->size.top, self->client_area.width, self->client_area.height); @@ -1271,9 +1267,9 @@ void frame_update_layout(gpointer _self, gboolean is_resize, gboolean is_fake) vals[1] = self->size.right; vals[2] = self->size.top; vals[3] = self->size.bottom; - OBT_PROP_SETA32(self->client->window, NET_FRAME_EXTENTS, CARDINAL, - vals, 4); - OBT_PROP_SETA32(self->client->window, KDE_NET_WM_FRAME_STRUT, + OBT_PROP_SETA32(self->client->w_client, NET_FRAME_EXTENTS, + CARDINAL, vals, 4); + OBT_PROP_SETA32(self->client->w_client, KDE_NET_WM_FRAME_STRUT, CARDINAL, vals, 4); } @@ -1318,7 +1314,7 @@ gint frame_get_decorations(gpointer self) return OBDEFAULTFRAME(self)->decorations; } -void frame_update_title (gpointer self, const gchar * src) +void frame_update_title(gpointer self, const gchar * src) { g_free(OBDEFAULTFRAME(self)->stitle); OBDEFAULTFRAME(self)->stitle = g_strdup(src); @@ -1444,69 +1440,49 @@ void frame_adjust_cursors(gpointer _self) /* these ones turn off when max vert, and some when shaded */ a.cursor = ob_cursor(r && topbot && !sh ? OB_CURSOR_NORTH : OB_CURSOR_NONE); - XChangeWindowAttributes(obp_display, self->topresize, CWCursor, - &a); + XChangeWindowAttributes(obp_display, self->topresize, CWCursor, &a); XChangeWindowAttributes(obp_display, self->titletop, CWCursor, &a); a.cursor = ob_cursor(r && topbot ? OB_CURSOR_SOUTH : OB_CURSOR_NONE); XChangeWindowAttributes(obp_display, self->handle, CWCursor, &a); - XChangeWindowAttributes(obp_display, self->handletop, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->handlebottom, - CWCursor, &a); - XChangeWindowAttributes(obp_display, self->innerbottom, CWCursor, - &a); + XChangeWindowAttributes(obp_display, self->handletop, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->handlebottom, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->innerbottom, CWCursor, &a); /* these ones change when shaded */ a.cursor = ob_cursor(r ? (sh ? OB_CURSOR_WEST : OB_CURSOR_NORTHWEST) : OB_CURSOR_NONE); - XChangeWindowAttributes(obp_display, self->titleleft, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->tltresize, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->tllresize, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->titletopleft, - CWCursor, &a); + XChangeWindowAttributes(obp_display, self->titleleft, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->tltresize, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->tllresize, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->titletopleft, CWCursor, &a); a.cursor = ob_cursor(r ? (sh ? OB_CURSOR_EAST : OB_CURSOR_NORTHEAST) : OB_CURSOR_NONE); - XChangeWindowAttributes(obp_display, self->titleright, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->trtresize, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->trrresize, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->titletopright, - CWCursor, &a); + XChangeWindowAttributes(obp_display, self->titleright, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->trtresize, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->trrresize, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->titletopright, CWCursor, &a); /* these ones are pretty static */ a.cursor = ob_cursor(r ? OB_CURSOR_WEST : OB_CURSOR_NONE); XChangeWindowAttributes(obp_display, self->left, CWCursor, &a); - XChangeWindowAttributes(obp_display, self->innerleft, CWCursor, - &a); + XChangeWindowAttributes(obp_display, self->innerleft, CWCursor, &a); a.cursor = ob_cursor(r ? OB_CURSOR_EAST : OB_CURSOR_NONE); XChangeWindowAttributes(obp_display, self->right, CWCursor, &a); - XChangeWindowAttributes(obp_display, self->innerright, CWCursor, - &a); + XChangeWindowAttributes(obp_display, self->innerright, CWCursor, &a); a.cursor = ob_cursor(r ? OB_CURSOR_SOUTHWEST : OB_CURSOR_NONE); XChangeWindowAttributes(obp_display, self->lgrip, CWCursor, &a); - XChangeWindowAttributes(obp_display, self->handleleft, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->lgripleft, CWCursor, - &a); + XChangeWindowAttributes(obp_display, self->handleleft, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->lgripleft, CWCursor, &a); XChangeWindowAttributes(obp_display, self->lgriptop, CWCursor, &a); - XChangeWindowAttributes(obp_display, self->lgripbottom, CWCursor, - &a); + XChangeWindowAttributes(obp_display, self->lgripbottom, CWCursor, &a); XChangeWindowAttributes(obp_display, self->innerbll, CWCursor, &a); XChangeWindowAttributes(obp_display, self->innerblb, CWCursor, &a); a.cursor = ob_cursor(r ? OB_CURSOR_SOUTHEAST : OB_CURSOR_NONE); XChangeWindowAttributes(obp_display, self->rgrip, CWCursor, &a); - XChangeWindowAttributes(obp_display, self->handleright, CWCursor, - &a); - XChangeWindowAttributes(obp_display, self->rgripright, CWCursor, - &a); + XChangeWindowAttributes(obp_display, self->handleright, CWCursor, &a); + XChangeWindowAttributes(obp_display, self->rgripright, CWCursor, &a); XChangeWindowAttributes(obp_display, self->rgriptop, CWCursor, &a); - XChangeWindowAttributes(obp_display, self->rgripbottom, CWCursor, - &a); + XChangeWindowAttributes(obp_display, self->rgripbottom, CWCursor, &a); XChangeWindowAttributes(obp_display, self->innerbrr, CWCursor, &a); XChangeWindowAttributes(obp_display, self->innerbrb, CWCursor, &a); } @@ -1769,8 +1745,8 @@ void layout_title(ObDefaultFrame * self) if (self->max_on) { XMapWindow(obp_display, self->max); - XMoveWindow(obp_display, self->max, self->max_x, - theme_config.paddingy + 1); + XMoveWindow(obp_display, self->max, self->max_x, theme_config.paddingy + + 1); } else XUnmapWindow(obp_display, self->max); @@ -1793,76 +1769,112 @@ void layout_title(ObDefaultFrame * self) XUnmapWindow(obp_display, self->label); } -void trigger_none (gpointer self) {} -void trigger_iconify(gpointer self) {} -void trigger_uniconnity(gpointer self) {} -void trigger_iconify_toggle(gpointer self) {} -void trigger_shade(gpointer self) {} -void trigger_unshade(gpointer self) {} -void trigger_shade_toggle(gpointer self) {} -void trigger_max(gpointer self) {} -void trigger_unmax(gpointer self) {} -void trigger_max_troggle(gpointer self) {} -void trigger_max_vert(gpointer self) {OBDEFAULTFRAME(self)->max_vert = TRUE;} -void trigger_unmax_vert(gpointer self) {OBDEFAULTFRAME(self)->max_vert = FALSE;} -void trigger_max_toggle(gpointer self) {} -void trigger_max_horz(gpointer self) {OBDEFAULTFRAME(self)->max_horz = TRUE;} -void trigger_unmax_horz(gpointer self) {OBDEFAULTFRAME(self)->max_horz = FALSE;} -void trigger_max_horz_toggle(gpointer self) {} -void trigger_plugin1(gpointer self) {} -void trigger_plugin2(gpointer self) {} -void trigger_plugin3(gpointer self) {} -void trigger_plugin4(gpointer self) {} -void trigger_plugin5(gpointer self) {} -void trigger_plugin6(gpointer self) {} -void trigger_plugin7(gpointer self) {} -void trigger_plugin8(gpointer self) {} -void trigger_plugin9(gpointer self) {} +void trigger_none(gpointer self) +{ +} +void trigger_iconify(gpointer self) +{ +} +void trigger_uniconnity(gpointer self) +{ +} +void trigger_iconify_toggle(gpointer self) +{ +} +void trigger_shade(gpointer self) +{ +} +void trigger_unshade(gpointer self) +{ +} +void trigger_shade_toggle(gpointer self) +{ +} +void trigger_max(gpointer self) +{ +} +void trigger_unmax(gpointer self) +{ +} +void trigger_max_troggle(gpointer self) +{ +} +void trigger_max_vert(gpointer self) +{ + OBDEFAULTFRAME(self)->max_vert = TRUE; +} +void trigger_unmax_vert(gpointer self) +{ + OBDEFAULTFRAME(self)->max_vert = FALSE; +} +void trigger_max_toggle(gpointer self) +{ +} +void trigger_max_horz(gpointer self) +{ + OBDEFAULTFRAME(self)->max_horz = TRUE; +} +void trigger_unmax_horz(gpointer self) +{ + OBDEFAULTFRAME(self)->max_horz = FALSE; +} +void trigger_max_horz_toggle(gpointer self) +{ +} +void trigger_plugin1(gpointer self) +{ +} +void trigger_plugin2(gpointer self) +{ +} +void trigger_plugin3(gpointer self) +{ +} +void trigger_plugin4(gpointer self) +{ +} +void trigger_plugin5(gpointer self) +{ +} +void trigger_plugin6(gpointer self) +{ +} +void trigger_plugin7(gpointer self) +{ +} +void trigger_plugin8(gpointer self) +{ +} +void trigger_plugin9(gpointer self) +{ +} void frame_trigger(gpointer self, ObFrameTrigger trigger_name) { - static void (*trigger_func[64])(gpointer) = { - trigger_none, - trigger_iconify, - trigger_uniconnity, - trigger_iconify_toggle, - trigger_shade, - trigger_unshade, - trigger_shade_toggle, - trigger_max, - trigger_unmax, - trigger_max_troggle, - trigger_max_vert, - trigger_unmax_vert, - trigger_max_toggle, - trigger_max_horz, - trigger_unmax_horz, - trigger_max_horz_toggle, - trigger_plugin1, - trigger_plugin2, - trigger_plugin3, - trigger_plugin4, - trigger_plugin5, - trigger_plugin6, - trigger_plugin7, - trigger_plugin8, - trigger_plugin9, - NULL, - }; - - void (*call_trigger_func)(gpointer) = trigger_func[trigger_name]; - if(!call_trigger_func) - { - call_trigger_func (self); - } + static void (*trigger_func[64])(gpointer) = { trigger_none, + trigger_iconify, trigger_uniconnity, trigger_iconify_toggle, + trigger_shade, trigger_unshade, trigger_shade_toggle, + trigger_max, trigger_unmax, trigger_max_troggle, + trigger_max_vert, trigger_unmax_vert, trigger_max_toggle, + trigger_max_horz, trigger_unmax_horz, + trigger_max_horz_toggle, trigger_plugin1, trigger_plugin2, + trigger_plugin3, trigger_plugin4, trigger_plugin5, + trigger_plugin6, trigger_plugin7, trigger_plugin8, + trigger_plugin9, NULL, +}; + +void (*call_trigger_func)(gpointer) = trigger_func[trigger_name]; +if(!call_trigger_func) +{ + call_trigger_func (self); +} } -ObFramePlugin plugin = { - 0, /* gpointer handler */ - "libdefault.la", /* gchar * filename */ - "Default", /* gchar * name */ - init, //gint (*init) (Display * display, gint screen); +ObFramePlugin plugin = { 0, /* gpointer handler */ +"libdefault.la", /* gchar * filename */ +"Default", /* gchar * name */ +init, //gint (*init) (Display * display, gint screen); 0, /* */ frame_new, //gpointer (*frame_new) (struct _ObClient *c); frame_free, //void (*frame_free) (gpointer self); @@ -1885,7 +1897,7 @@ ObFramePlugin plugin = { frame_iconify_animating, /* */ frame_set_decorations, /* */ - + frame_update_title, /* */ /* This give the window area */ frame_get_window_area, /* */ @@ -1912,9 +1924,9 @@ ObFramePlugin plugin = { /* This fields are fill by openbox. */ //0, //Display * ob_display; - //0, //gint ob_screen; - //0, //RrInstance *ob_rr_inst; - 0, //gboolean config_theme_keepborder; + //0, //gint ob_screen; + //0, //RrInstance *ob_rr_inst; + 0, //gboolean config_theme_keepborder; 0, //struct _ObClient *focus_cycle_target; 0, //gchar *config_title_layout; FALSE, //gboolean moveresize_in_progress; diff --git a/engines/default/plugin.h b/engines/default/plugin.h index cb12379a..3b869321 100644 --- a/engines/default/plugin.h +++ b/engines/default/plugin.h @@ -34,7 +34,7 @@ struct _ObDefaultFrame Window window; gchar * stitle; /* The current title we draw */ - + gboolean visible; gboolean max_horz; /* when maxed some decorations are hidden */ @@ -159,7 +159,7 @@ typedef struct _ObDefaultFrame ObDefaultFrame; /* Function use for interface */ gint init(Display *, gint); -gpointer frame_new(struct _ObClient *c); +gpointer frame_new(struct _ObClient *, Window, Window); void frame_free(gpointer self); void frame_show(gpointer self); gint frame_hide(gpointer self); @@ -184,8 +184,7 @@ void frame_adjust_focus(gpointer self, gboolean hilite); void frame_adjust_title(gpointer self); void frame_adjust_icon(gpointer self); -gulong frame_animate_iconify_time_left(gpointer _self, - const GTimeVal *now); +gulong frame_animate_iconify_time_left(gpointer _self, const GTimeVal *now); ObFrameContext frame_context(gpointer, Window win, gint x, gint y); @@ -204,7 +203,7 @@ Strut frame_get_size(gpointer self); Rect frame_get_area(gpointer self); gint frame_get_decorations(gpointer self); -void frame_update_title (gpointer, const gchar *); +void frame_update_title(gpointer, const gchar *); gboolean frame_is_visible(gpointer self); gboolean frame_is_max_horz(gpointer self); diff --git a/openbox/client.c b/openbox/client.c index aacb6ebf..a9cbd917 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -164,7 +164,7 @@ void client_set_list(void) windows = g_new(Window, size); win_it = windows; for (it = client_list; it; it = g_list_next(it), ++win_it) - *win_it = ((ObClient*)it->data)->window; + *win_it = ((ObClient*)it->data)->w_client; } else windows = NULL; @@ -203,7 +203,7 @@ void client_manage(Window window, ObPrompt *prompt) window */ self = g_new0(ObClient, 1); self->obwin.type = OB_WINDOW_CLASS_CLIENT; - self->window = window; + self->w_client = window; self->prompt = prompt; /* non-zero defaults */ @@ -229,7 +229,7 @@ void client_manage(Window window, ObPrompt *prompt) XChangeSaveSet(obt_display, window, SetModeInsert); /* create the decoration frame for the client window */ - self->frame = render_plugin->frame_new(self); + self->frame = render_plugin->frame_new(self, self->w_client, self->w_frame); render_plugin->frame_grab(self->frame, window_map); /* we've grabbed everything and set everything that we need to at mapping @@ -270,7 +270,7 @@ void client_manage(Window window, ObPrompt *prompt) } /* remove the client's border */ - XSetWindowBorderWidth(obt_display, self->window, 0); + XSetWindowBorderWidth(obt_display, self->w_client, 0); /* adjust the frame to the client's size before showing or placing the window */ @@ -381,7 +381,7 @@ void client_manage(Window window, ObPrompt *prompt) ob_debug("placing window 0x%x at %d, %d with size %d x %d. " "some restrictions may apply", - self->window, place.x, place.y, place.width, place.height); + self->w_client, place.x, place.y, place.width, place.height); if (self->session) ob_debug(" but session requested %d, %d %d x %d instead, " "overriding", @@ -408,7 +408,7 @@ void client_manage(Window window, ObPrompt *prompt) ob_debug_type(OB_DEBUG_FOCUS, "Want to focus new window 0x%x at time %u " "launched at %u (last user interaction time %u)", - self->window, map_time, launch_time, + self->w_client, map_time, launch_time, event_last_user_time); if (menu_frame_visible || render_plugin->moveresize_in_progress) { @@ -536,7 +536,7 @@ void client_manage(Window window, ObPrompt *prompt) /* add to client list/map */ client_list = g_list_append(client_list, self); - window_add(&self->window, CLIENT_AS_WINDOW(self)); + window_add(&self->w_client, CLIENT_AS_WINDOW(self)); /* this has to happen after we're in the client_list */ if (STRUT_EXISTS(self->strut)) @@ -572,7 +572,7 @@ ObClient *client_fake_manage(Window window) /* do this minimal stuff to figure out the client's decorations */ self = g_new0(ObClient, 1); - self->window = window; + self->w_client = window; client_get_all(self, FALSE); /* per-app settings override stuff, and return the settings for other @@ -582,7 +582,7 @@ ObClient *client_fake_manage(Window window) client_setup_decor_and_functions(self, FALSE); /* create the decoration frame for the client window and adjust its size */ - self->frame = render_plugin->frame_new(self); + self->frame = render_plugin->frame_new(self, self->w_client, self->w_frame); render_plugin->frame_set_decorations (self->frame, self->decorations); render_plugin->frame_update_title (self->frame, self->title); render_plugin->frame_update_layout (self->frame, FALSE, FALSE); @@ -611,14 +611,14 @@ void client_unmanage(ObClient *self) gulong ignore_start; ob_debug("Unmanaging window: 0x%x plate 0x%x (%s) (%s)", - self->window, render_plugin->frame_get_window(self->frame), + self->w_client, render_plugin->frame_get_window(self->frame), self->class, self->title ? self->title : ""); g_assert(self != NULL); /* we dont want events no more. do this before hiding the frame so we don't generate more events */ - XSelectInput(obt_display, self->window, NoEventMask); + XSelectInput(obt_display, self->w_client, NoEventMask); /* ignore enter events from the unmap so it doesnt mess with the focus */ if (!config_focus_under_mouse) @@ -636,7 +636,7 @@ void client_unmanage(ObClient *self) /* remove the window from our save set, unless we are managing an internal ObPrompt window */ if (!self->prompt) - XChangeSaveSet(obt_display, self->window, SetModeDelete); + XChangeSaveSet(obt_display, self->w_client, SetModeDelete); /* update the focus lists */ focus_order_remove(self); @@ -651,7 +651,7 @@ void client_unmanage(ObClient *self) client_list = g_list_remove(client_list, self); stacking_remove(self); - window_remove(self->window); + window_remove(self->w_client); /* once the client is out of the list, update the struts to remove its influence */ @@ -706,7 +706,7 @@ void client_unmanage(ObClient *self) self->decorations = 0; /* unmanaged windows have no decor */ /* give the client its border back */ - XSetWindowBorderWidth(obt_display, self->window, self->border_width); + XSetWindowBorderWidth(obt_display, self->w_client, self->border_width); client_move_resize(self, a.x, a.y, a.width, a.height); } @@ -719,25 +719,25 @@ void client_unmanage(ObClient *self) if (ob_state() != OB_STATE_EXITING) { /* these values should not be persisted across a window unmapping/mapping */ - OBT_PROP_ERASE(self->window, NET_WM_DESKTOP); - OBT_PROP_ERASE(self->window, NET_WM_STATE); - OBT_PROP_ERASE(self->window, WM_STATE); + OBT_PROP_ERASE(self->w_client, NET_WM_DESKTOP); + OBT_PROP_ERASE(self->w_client, NET_WM_STATE); + OBT_PROP_ERASE(self->w_client, WM_STATE); } else { /* if we're left in an unmapped state, the client wont be mapped. this is bad, since we will no longer be managing the window on restart */ - XMapWindow(obt_display, self->window); + XMapWindow(obt_display, self->w_client); } /* these should not be left on the window ever. other window managers don't necessarily use them and it will mess them up (like compiz) */ - OBT_PROP_ERASE(self->window, NET_WM_VISIBLE_NAME); - OBT_PROP_ERASE(self->window, NET_WM_VISIBLE_ICON_NAME); + OBT_PROP_ERASE(self->w_client, NET_WM_VISIBLE_NAME); + OBT_PROP_ERASE(self->w_client, NET_WM_VISIBLE_ICON_NAME); /* update the list hints */ client_set_list(); - ob_debug("Unmanaged window 0x%lx", self->window); + ob_debug("Unmanaged window 0x%lx", self->w_client); /* free all data allocated in the client struct */ g_slist_free(self->transients); @@ -871,13 +871,13 @@ static void client_restore_session_state(ObClient *self) self->area.width = self->session->w; if (self->session->h > 0) self->area.height = self->session->h; - XResizeWindow(obt_display, self->window, + XResizeWindow(obt_display, self->w_client, self->area.width, self->area.height); self->desktop = (self->session->desktop == DESKTOP_ALL ? self->session->desktop : MIN(screen_num_desktops - 1, self->session->desktop)); - OBT_PROP_SET32(self->window, NET_WM_DESKTOP, CARDINAL, self->desktop); + OBT_PROP_SET32(self->w_client, NET_WM_DESKTOP, CARDINAL, self->desktop); self->shaded = self->session->shaded; self->iconic = self->session->iconic; @@ -1121,7 +1121,7 @@ static void client_get_all(ObClient *self, gboolean real) static void client_get_startup_id(ObClient *self) { - if (!(OBT_PROP_GETS(self->window, NET_STARTUP_ID, utf8, + if (!(OBT_PROP_GETS(self->w_client, NET_STARTUP_ID, utf8, &self->startup_id))) if (self->group) OBT_PROP_GETS(self->group->leader, @@ -1133,7 +1133,7 @@ static void client_get_area(ObClient *self) XWindowAttributes wattrib; Status ret; - ret = XGetWindowAttributes(obt_display, self->window, &wattrib); + ret = XGetWindowAttributes(obt_display, self->w_client, &wattrib); g_assert(ret != BadWindow); RECT_SET(self->area, wattrib.x, wattrib.y, wattrib.width, wattrib.height); @@ -1148,7 +1148,7 @@ static void client_get_desktop(ObClient *self) { guint32 d = screen_num_desktops; /* an always-invalid value */ - if (OBT_PROP_GET32(self->window, NET_WM_DESKTOP, CARDINAL, &d)) { + if (OBT_PROP_GET32(self->w_client, NET_WM_DESKTOP, CARDINAL, &d)) { if (d >= screen_num_desktops && d != DESKTOP_ALL) self->desktop = screen_num_desktops - 1; else @@ -1201,7 +1201,7 @@ static void client_get_state(ObClient *self) guint32 *state; guint num; - if (OBT_PROP_GETA32(self->window, NET_WM_STATE, ATOM, &state, &num)) { + if (OBT_PROP_GETA32(self->w_client, NET_WM_STATE, ATOM, &state, &num)) { gulong i; for (i = 0; i < num; ++i) { if (state[i] == OBT_PROP_ATOM(NET_WM_STATE_MODAL)) @@ -1247,9 +1247,9 @@ static void client_get_shaped(ObClient *self) guint ufoo; gint s; - XShapeSelectInput(obt_display, self->window, ShapeNotifyMask); + XShapeSelectInput(obt_display, self->w_client, ShapeNotifyMask); - XShapeQueryExtents(obt_display, self->window, &s, &foo, + XShapeQueryExtents(obt_display, self->w_client, &s, &foo, &foo, &ufoo, &ufoo, &foo, &foo, &foo, &ufoo, &ufoo); self->shaped = (s != 0); @@ -1263,8 +1263,8 @@ void client_update_transient_for(ObClient *self) ObClient *target = NULL; gboolean trangroup = FALSE; - if (XGetTransientForHint(obt_display, self->window, &t)) { - if (t != self->window) { /* cant be transient to itself! */ + if (XGetTransientForHint(obt_display, self->w_client, &t)) { + if (t != self->w_client) { /* cant be transient to itself! */ ObWindow *tw = window_find(t); /* if this happens then we need to check for it*/ g_assert(tw != CLIENT_AS_WINDOW(self)); @@ -1414,7 +1414,7 @@ static void client_get_mwm_hints(ObClient *self) self->mwmhints.flags = 0; /* default to none */ - if (OBT_PROP_GETA32(self->window, MOTIF_WM_HINTS, MOTIF_WM_HINTS, + if (OBT_PROP_GETA32(self->w_client, MOTIF_WM_HINTS, MOTIF_WM_HINTS, &hints, &num)) { if (num >= OB_MWM_ELEMENTS) { self->mwmhints.flags = hints[0]; @@ -1434,7 +1434,7 @@ void client_get_type_and_transientness(ObClient *self) self->type = -1; self->transient = FALSE; - if (OBT_PROP_GETA32(self->window, NET_WM_WINDOW_TYPE, ATOM, &val, &num)) { + if (OBT_PROP_GETA32(self->w_client, NET_WM_WINDOW_TYPE, ATOM, &val, &num)) { /* use the first value that we know about in the array */ for (i = 0; i < num; ++i) { if (val[i] == OBT_PROP_ATOM(NET_WM_WINDOW_TYPE_DESKTOP)) @@ -1468,7 +1468,7 @@ void client_get_type_and_transientness(ObClient *self) g_free(val); } - if (XGetTransientForHint(obt_display, self->window, &t)) + if (XGetTransientForHint(obt_display, self->w_client, &t)) self->transient = TRUE; if (self->type == (ObClientType) -1) { @@ -1499,7 +1499,7 @@ void client_update_protocols(ObClient *self) self->focus_notify = FALSE; self->delete_window = FALSE; - if (OBT_PROP_GETA32(self->window, WM_PROTOCOLS, ATOM, &proto, &num_ret)) { + if (OBT_PROP_GETA32(self->w_client, WM_PROTOCOLS, ATOM, &proto, &num_ret)) { for (i = 0; i < num_ret; ++i) { if (proto[i] == OBT_PROP_ATOM(WM_DELETE_WINDOW)) /* this means we can request the window to close */ @@ -1529,7 +1529,7 @@ void client_update_sync_request_counter(ObClient *self) { guint32 i; - if (OBT_PROP_GET32(self->window, NET_WM_SYNC_REQUEST_COUNTER, CARDINAL,&i)) + if (OBT_PROP_GET32(self->w_client, NET_WM_SYNC_REQUEST_COUNTER, CARDINAL,&i)) { self->sync_counter = i; } else @@ -1541,7 +1541,7 @@ static void client_get_colormap(ObClient *self) { XWindowAttributes wa; - if (XGetWindowAttributes(obt_display, self->window, &wa)) + if (XGetWindowAttributes(obt_display, self->w_client, &wa)) client_update_colormap(self, wa.colormap); } @@ -1573,7 +1573,7 @@ void client_update_normal_hints(ObClient *self) SIZE_SET(self->max_size, G_MAXINT, G_MAXINT); /* get the hints from the window */ - if (XGetWMNormalHints(obt_display, self->window, &size, &ret)) { + if (XGetWMNormalHints(obt_display, self->w_client, &size, &ret)) { /* normal windows can't request placement! har har if (!client_normal(self)) */ @@ -1810,7 +1810,7 @@ static void client_change_allowed_actions(ObClient *self) if (self->functions & OB_CLIENT_FUNC_UNDECORATE) actions[num++] = OBT_PROP_ATOM(OB_WM_ACTION_UNDECORATE); - OBT_PROP_SETA32(self->window, NET_WM_ALLOWED_ACTIONS, ATOM, actions, num); + OBT_PROP_SETA32(self->w_client, NET_WM_ALLOWED_ACTIONS, ATOM, actions, num); /* make sure the window isn't breaking any rules now @@ -1845,7 +1845,7 @@ void client_update_wmhints(ObClient *self) /* assume a window takes input if it doesnt specify */ self->can_focus = TRUE; - if ((hints = XGetWMHints(obt_display, self->window)) != NULL) { + if ((hints = XGetWMHints(obt_display, self->w_client)) != NULL) { gboolean ur; if (hints->flags & InputHint) @@ -1934,10 +1934,10 @@ void client_update_title(ObClient *self) g_free(self->original_title); /* try netwm */ - if (!OBT_PROP_GETS(self->window, NET_WM_NAME, utf8, &data)) { + if (!OBT_PROP_GETS(self->w_client, NET_WM_NAME, utf8, &data)) { /* try old x stuff */ - if (!(OBT_PROP_GETS(self->window, WM_NAME, locale, &data) - || OBT_PROP_GETS(self->window, WM_NAME, utf8, &data))) { + if (!(OBT_PROP_GETS(self->w_client, WM_NAME, locale, &data) + || OBT_PROP_GETS(self->w_client, WM_NAME, utf8, &data))) { if (self->transient) { /* GNOME alert windows are not given titles: @@ -1965,7 +1965,7 @@ void client_update_title(ObClient *self) g_free(data); } - OBT_PROP_SETS(self->window, NET_WM_VISIBLE_NAME, utf8, visible); + OBT_PROP_SETS(self->w_client, NET_WM_VISIBLE_NAME, utf8, visible); self->title = visible; if (self->frame) { @@ -1979,10 +1979,10 @@ void client_update_title(ObClient *self) g_free(self->icon_title); /* try netwm */ - if (!OBT_PROP_GETS(self->window, NET_WM_ICON_NAME, utf8, &data)) + if (!OBT_PROP_GETS(self->w_client, NET_WM_ICON_NAME, utf8, &data)) /* try old x stuff */ - if (!(OBT_PROP_GETS(self->window, WM_ICON_NAME, locale, &data) || - OBT_PROP_GETS(self->window, WM_ICON_NAME, utf8, &data))) + if (!(OBT_PROP_GETS(self->w_client, WM_ICON_NAME, locale, &data) || + OBT_PROP_GETS(self->w_client, WM_ICON_NAME, utf8, &data))) data = g_strdup(self->title); if (self->client_machine) { @@ -2000,7 +2000,7 @@ void client_update_title(ObClient *self) g_free(data); } - OBT_PROP_SETS(self->window, NET_WM_VISIBLE_ICON_NAME, utf8, visible); + OBT_PROP_SETS(self->w_client, NET_WM_VISIBLE_ICON_NAME, utf8, visible); self->icon_title = visible; } @@ -2011,7 +2011,7 @@ void client_update_strut(ObClient *self) gboolean got = FALSE; StrutPartial strut; - if (OBT_PROP_GETA32(self->window, NET_WM_STRUT_PARTIAL, CARDINAL, + if (OBT_PROP_GETA32(self->w_client, NET_WM_STRUT_PARTIAL, CARDINAL, &data, &num)) { if (num == 12) { @@ -2025,7 +2025,7 @@ void client_update_strut(ObClient *self) } if (!got && - OBT_PROP_GETA32(self->window, NET_WM_STRUT, CARDINAL, &data, &num)) { + OBT_PROP_GETA32(self->w_client, NET_WM_STRUT, CARDINAL, &data, &num)) { if (num == 4) { Rect *a; @@ -2077,7 +2077,7 @@ void client_update_icons(ObClient *self) g_free(self->icons); self->nicons = 0; - if (OBT_PROP_GETA32(self->window, NET_WM_ICON, CARDINAL, &data, &num)) { + if (OBT_PROP_GETA32(self->w_client, NET_WM_ICON, CARDINAL, &data, &num)) { /* figure out how many valid icons are in here */ i = 0; num_seen = num_small_seen = 0; @@ -2150,7 +2150,7 @@ void client_update_icons(ObClient *self) } else { XWMHints *hints; - if ((hints = XGetWMHints(obt_display, self->window))) { + if ((hints = XGetWMHints(obt_display, self->w_client))) { if (hints->flags & IconPixmapHint) { self->nicons = 1; self->icons = g_new(ObClientIcon, self->nicons); @@ -2190,7 +2190,7 @@ void client_update_icons(ObClient *self) (((icon[i] >> RrDefaultRedOffset) & 0xff) << 16) + (((icon[i] >> RrDefaultGreenOffset) & 0xff) << 8) + (((icon[i] >> RrDefaultBlueOffset) & 0xff) << 0); - OBT_PROP_SETA32(self->window, NET_WM_ICON, CARDINAL, data, 48*48+2); + OBT_PROP_SETA32(self->w_client, NET_WM_ICON, CARDINAL, data, 48*48+2); g_free(data); } else if (self->frame) render_plugin->frame_update_skin (self->frame); @@ -2206,7 +2206,7 @@ void client_update_icon_geometry(ObClient *self) RECT_SET(self->icon_geometry, 0, 0, 0, 0); - if (OBT_PROP_GETA32(self->window, NET_WM_ICON_GEOMETRY, CARDINAL, + if (OBT_PROP_GETA32(self->w_client, NET_WM_ICON_GEOMETRY, CARDINAL, &data, &num)) { if (num == 4) @@ -2224,7 +2224,7 @@ static void client_get_session_ids(ObClient *self) gchar *s; gchar **ss; - if (!OBT_PROP_GET32(self->window, WM_CLIENT_LEADER, WINDOW, &leader)) + if (!OBT_PROP_GET32(self->w_client, WM_CLIENT_LEADER, WINDOW, &leader)) leader = None; /* get the SM_CLIENT_ID */ @@ -2232,7 +2232,7 @@ static void client_get_session_ids(ObClient *self) if (leader) got = OBT_PROP_GETS(leader, SM_CLIENT_ID, locale, &self->sm_client_id); if (!got) - OBT_PROP_GETS(self->window, SM_CLIENT_ID, locale, &self->sm_client_id); + OBT_PROP_GETS(self->w_client, SM_CLIENT_ID, locale, &self->sm_client_id); /* get the WM_CLASS (name and class). make them "" if they are not provided */ @@ -2240,7 +2240,7 @@ static void client_get_session_ids(ObClient *self) if (leader) got = OBT_PROP_GETSS(leader, WM_CLASS, locale, &ss); if (!got) - got = OBT_PROP_GETSS(self->window, WM_CLASS, locale, &ss); + got = OBT_PROP_GETSS(self->w_client, WM_CLASS, locale, &ss); if (got) { if (ss[0]) { @@ -2259,7 +2259,7 @@ static void client_get_session_ids(ObClient *self) if (leader) got = OBT_PROP_GETS(leader, WM_WINDOW_ROLE, locale, &s); if (!got) - got = OBT_PROP_GETS(self->window, WM_WINDOW_ROLE, locale, &s); + got = OBT_PROP_GETS(self->w_client, WM_WINDOW_ROLE, locale, &s); if (got) self->role = s; @@ -2272,7 +2272,7 @@ static void client_get_session_ids(ObClient *self) if (leader) got = OBT_PROP_GETSS(leader, WM_COMMAND, locale, &ss); if (!got) - got = OBT_PROP_GETSS(self->window, WM_COMMAND, locale, &ss); + got = OBT_PROP_GETSS(self->w_client, WM_COMMAND, locale, &ss); if (got) { /* merge/mash them all together */ @@ -2297,7 +2297,7 @@ static void client_get_session_ids(ObClient *self) if (leader) got = OBT_PROP_GETS(leader, WM_CLIENT_MACHINE, locale, &s); if (!got) - got = OBT_PROP_GETS(self->window, WM_CLIENT_MACHINE, locale, &s); + got = OBT_PROP_GETS(self->w_client, WM_CLIENT_MACHINE, locale, &s); if (got) { gchar localhost[128]; @@ -2312,7 +2312,7 @@ static void client_get_session_ids(ObClient *self) /* see if it has the PID set too (the PID requires that the WM_CLIENT_MACHINE be set) */ - if (OBT_PROP_GET32(self->window, NET_WM_PID, CARDINAL, &pid)) + if (OBT_PROP_GET32(self->w_client, NET_WM_PID, CARDINAL, &pid)) self->pid = pid; } } @@ -2332,12 +2332,12 @@ static void client_change_wm_state(ObClient *self) self->wmstate = NormalState; if (old != self->wmstate) { - OBT_PROP_MSG(ob_screen, self->window, KDE_WM_CHANGE_STATE, + OBT_PROP_MSG(ob_screen, self->w_client, KDE_WM_CHANGE_STATE, self->wmstate, 1, 0, 0, 0); state[0] = self->wmstate; state[1] = None; - OBT_PROP_SETA32(self->window, WM_STATE, WM_STATE, state, 2); + OBT_PROP_SETA32(self->w_client, WM_STATE, WM_STATE, state, 2); } } @@ -2371,7 +2371,7 @@ static void client_change_state(ObClient *self) netstate[num++] = OBT_PROP_ATOM(NET_WM_STATE_DEMANDS_ATTENTION); if (self->undecorated) netstate[num++] = OBT_PROP_ATOM(OB_WM_STATE_UNDECORATED); - OBT_PROP_SETA32(self->window, NET_WM_STATE, ATOM, netstate, num); + OBT_PROP_SETA32(self->w_client, NET_WM_STATE, ATOM, netstate, num); if (self->frame) render_plugin->frame_update_layout (self->frame, FALSE, FALSE); @@ -2678,7 +2678,7 @@ static void client_apply_startup_state(ObClient *self, */ client_try_configure(self, &x, &y, &w, &h, &l, &l, FALSE); ob_debug("placed window 0x%x at %d, %d with size %d x %d", - self->window, x, y, w, h); + self->w_client, x, y, w, h); /* save the area, and make it where it should be for the premax stuff */ oldarea = self->area; RECT_SET(self->area, x, y, w, h); @@ -2721,7 +2721,7 @@ static void client_apply_startup_state(ObClient *self, client_configure(self, x, y, w, h, FALSE, TRUE, FALSE); /* set the desktop hint, to make sure that it always exists */ - OBT_PROP_SET32(self->window, NET_WM_DESKTOP, CARDINAL, self->desktop); + OBT_PROP_SET32(self->w_client, NET_WM_DESKTOP, CARDINAL, self->desktop); /* nothing to do for the other states: skip_taskbar @@ -3070,8 +3070,8 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, event.type = ConfigureNotify; event.xconfigure.display = obt_display; - event.xconfigure.event = self->window; - event.xconfigure.window = self->window; + event.xconfigure.event = self->w_client; + event.xconfigure.window = self->w_client; ob_debug("Sending ConfigureNotify to %s for %d,%d %dx%d", self->title, self->root_pos.x, self->root_pos.y, w, h); @@ -3177,7 +3177,7 @@ static void client_iconify_recursive(ObClient *self, if (self->iconic != iconic) { ob_debug("%sconifying window: 0x%lx", (iconic ? "I" : "Uni"), - self->window); + self->w_client); if (iconic) { /* don't let non-normal windows iconify along with their parents @@ -3351,10 +3351,10 @@ void client_close(ObClient *self) if (!self->delete_window) /* don't use client_kill(), we should only kill based on PID in response to a lack of PING replies */ - XKillClient(obt_display, self->window); + XKillClient(obt_display, self->w_client); else { /* request the client to close with WM_DELETE_WINDOW */ - OBT_PROP_MSG_TO(self->window, self->window, WM_PROTOCOLS, + OBT_PROP_MSG_TO(self->w_client, self->w_client, WM_PROTOCOLS, OBT_PROP_ATOM(WM_DELETE_WINDOW), event_curtime, 0, 0, 0, NoEventMask); @@ -3416,7 +3416,7 @@ void client_kill(ObClient *self) /* running on the local host */ if (self->kill_level == 0) { ob_debug("killing window 0x%x with pid %lu, with SIGTERM", - self->window, self->pid); + self->w_client, self->pid); kill(self->pid, SIGTERM); ++self->kill_level; @@ -3425,13 +3425,13 @@ void client_kill(ObClient *self) } else { ob_debug("killing window 0x%x with pid %lu, with SIGKILL", - self->window, self->pid); + self->w_client, self->pid); kill(self->pid, SIGKILL); /* kill -9 */ } } else { /* running on a remote host */ - XKillClient(obt_display, self->window); + XKillClient(obt_display, self->w_client); } } @@ -3467,7 +3467,7 @@ static void client_set_desktop_recursive(ObClient *self, old = self->desktop; self->desktop = target; - OBT_PROP_SET32(self->window, NET_WM_DESKTOP, CARDINAL, target); + OBT_PROP_SET32(self->w_client, NET_WM_DESKTOP, CARDINAL, target); /* the frame can display the current desktop state */ render_plugin->frame_set_decorations (self->frame, self->decorations); render_plugin->frame_update_layout(self->frame, FALSE, FALSE); @@ -3526,8 +3526,8 @@ gboolean client_validate(ObClient *self) XSync(obt_display, FALSE); /* get all events on the server */ - if (XCheckTypedWindowEvent(obt_display, self->window, DestroyNotify, &e) || - XCheckTypedWindowEvent(obt_display, self->window, UnmapNotify, &e)) + if (XCheckTypedWindowEvent(obt_display, self->w_client, DestroyNotify, &e) || + XCheckTypedWindowEvent(obt_display, self->w_client, UnmapNotify, &e)) { XPutBackEvent(obt_display, &e); return FALSE; @@ -3770,7 +3770,7 @@ gboolean client_focus(ObClient *self) ob_debug_type(OB_DEBUG_FOCUS, "Focusing client \"%s\" (0x%x) at time %u", - self->title, self->window, event_curtime); + self->title, self->w_client, event_curtime); /* if using focus_delay, stop the timer now so that focus doesn't go moving on us */ @@ -3790,7 +3790,7 @@ gboolean client_focus(ObClient *self) if (self->can_focus) { /* This can cause a BadMatch error with CurrentTime, or if an app passed in a bad time for _NET_WM_ACTIVE_WINDOW. */ - XSetInputFocus(obt_display, self->window, RevertToPointerRoot, + XSetInputFocus(obt_display, self->w_client, RevertToPointerRoot, event_curtime); } @@ -3799,14 +3799,14 @@ gboolean client_focus(ObClient *self) ce.xclient.type = ClientMessage; ce.xclient.message_type = OBT_PROP_ATOM(WM_PROTOCOLS); ce.xclient.display = obt_display; - ce.xclient.window = self->window; + ce.xclient.window = self->w_client; ce.xclient.format = 32; ce.xclient.data.l[0] = OBT_PROP_ATOM(WM_TAKE_FOCUS); ce.xclient.data.l[1] = event_curtime; ce.xclient.data.l[2] = 0l; ce.xclient.data.l[3] = 0l; ce.xclient.data.l[4] = 0l; - XSendEvent(obt_display, self->window, FALSE, NoEventMask, &ce); + XSendEvent(obt_display, self->w_client, FALSE, NoEventMask, &ce); } obt_display_ignore_errors(FALSE); diff --git a/openbox/client.h b/openbox/client.h index dbe93d28..2cceb618 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -81,7 +81,8 @@ typedef enum struct _ObClient { ObWindow obwin; - Window window; + Window w_client; + Window w_frame; /*! If this client is managing an ObPrompt window, then this is set to the prompt */ diff --git a/openbox/engine_interface.c b/openbox/engine_interface.c index 3f8348f2..6ba3091c 100644 --- a/openbox/engine_interface.c +++ b/openbox/engine_interface.c @@ -274,7 +274,7 @@ ObFrameContext plugin_frame_context(ObClient *client, Window win, gint x, gint y return OB_FRAME_CONTEXT_ROOT; if (client == NULL) return OB_FRAME_CONTEXT_NONE; - if (win == client->window) { + if (win == client->w_client) { /* conceptually, this is the desktop, as far as users are concerned */ if (client->type == OB_CLIENT_TYPE_DESKTOP) diff --git a/openbox/engine_interface.h b/openbox/engine_interface.h index 2968ebdf..506b1f15 100644 --- a/openbox/engine_interface.h +++ b/openbox/engine_interface.h @@ -131,7 +131,7 @@ struct _ObFramePlugin gint (*release)(void); /* create a new frame, return the ID of frame */ - gpointer (*frame_new)(struct _ObClient *c); + gpointer (*frame_new)(struct _ObClient *c, Window w_client, Window w_frame); /* Free the frame */ void (*frame_free)(gpointer self); diff --git a/openbox/event.c b/openbox/event.c index dbc7058d..c49d4603 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -819,7 +819,7 @@ void event_enter_client(ObClient *client) if (is_enter_focus_event_ignored(event_curserial)) { ob_debug_type(OB_DEBUG_FOCUS, "Ignoring enter event with serial %lu\n" - "on client 0x%x", event_curserial, client->window); + "on client 0x%x", event_curserial, client->w_client); return; } @@ -978,7 +978,7 @@ static void event_handle_client(ObClient *client, XEvent *e) "%sNotify mode %d detail %d on %lx", (e->type == EnterNotify ? "Enter" : "Leave"), e->xcrossing.mode, - e->xcrossing.detail, (client?client->window:0)); + e->xcrossing.detail, (client?client->w_client:0)); if (grab_on_keyboard()) break; if (config_focus_follow && config_focus_delay && @@ -1031,7 +1031,7 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xcrossing.mode, e->xcrossing.detail, e->xcrossing.serial, - client?client->window:0); + client?client->w_client:0); } else { ob_debug_type(OB_DEBUG_FOCUS, @@ -1041,7 +1041,7 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xcrossing.mode, e->xcrossing.detail, e->xcrossing.serial, - (client?client->window:0)); + (client?client->w_client:0)); if (config_focus_follow) event_enter_client(client); } @@ -1214,7 +1214,7 @@ static void event_handle_client(ObClient *client, XEvent *e) case UnmapNotify: ob_debug("UnmapNotify for window 0x%x eventwin 0x%x sendevent %d " "ignores left %d", - client->window, e->xunmap.event, e->xunmap.from_configure, + client->w_client, e->xunmap.event, e->xunmap.from_configure, client->ignore_unmaps); if (client->ignore_unmaps) { client->ignore_unmaps--; @@ -1223,7 +1223,7 @@ static void event_handle_client(ObClient *client, XEvent *e) client_unmanage(client); break; case DestroyNotify: - ob_debug("DestroyNotify for window 0x%x", client->window); + ob_debug("DestroyNotify for window 0x%x", client->w_client); client_unmanage(client); break; case ReparentNotify: @@ -1241,11 +1241,11 @@ static void event_handle_client(ObClient *client, XEvent *e) X server to deal with after we unmanage the window */ XPutBackEvent(obt_display, e); - ob_debug("ReparentNotify for window 0x%x", client->window); + ob_debug("ReparentNotify for window 0x%x", client->w_client); client_unmanage(client); break; case MapRequest: - ob_debug("MapRequest for 0x%lx", client->window); + ob_debug("MapRequest for 0x%lx", client->w_client); if (!client->iconic) break; /* this normally doesn't happen, but if it does, we don't want it! it can happen now when the window is on @@ -1262,7 +1262,7 @@ static void event_handle_client(ObClient *client, XEvent *e) msgtype = e->xclient.message_type; if (msgtype == OBT_PROP_ATOM(WM_CHANGE_STATE)) { /* compress changes into a single change */ - while (XCheckTypedWindowEvent(obt_display, client->window, + while (XCheckTypedWindowEvent(obt_display, client->w_client, e->type, &ce)) { /* XXX: it would be nice to compress ALL messages of a type, not just messages in a row without other @@ -1276,7 +1276,7 @@ static void event_handle_client(ObClient *client, XEvent *e) client_set_wm_state(client, e->xclient.data.l[0]); } else if (msgtype == OBT_PROP_ATOM(NET_WM_DESKTOP)) { /* compress changes into a single change */ - while (XCheckTypedWindowEvent(obt_display, client->window, + while (XCheckTypedWindowEvent(obt_display, client->w_client, e->type, &ce)) { /* XXX: it would be nice to compress ALL messages of a type, not just messages in a row without other @@ -1300,7 +1300,7 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xclient.data.l[0] == 1 ? "Add" : e->xclient.data.l[0] == 2 ? "Toggle" : "INVALID"), e->xclient.data.l[1], e->xclient.data.l[2], - client->window); + client->w_client); /* ignore enter events caused by these like ob actions do */ if (!config_focus_under_mouse) @@ -1310,11 +1310,11 @@ static void event_handle_client(ObClient *client, XEvent *e) if (!config_focus_under_mouse) event_end_ignore_all_enters(ignore_start); } else if (msgtype == OBT_PROP_ATOM(NET_CLOSE_WINDOW)) { - ob_debug("net_close_window for 0x%lx", client->window); + ob_debug("net_close_window for 0x%lx", client->w_client); client_close(client); } else if (msgtype == OBT_PROP_ATOM(NET_ACTIVE_WINDOW)) { ob_debug("net_active_window for 0x%lx source=%s", - client->window, + client->w_client, (e->xclient.data.l[0] == 0 ? "unknown" : (e->xclient.data.l[0] == 1 ? "application" : (e->xclient.data.l[0] == 2 ? "user" : "INVALID")))); @@ -1337,7 +1337,7 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xclient.data.l[0] == 2)); } else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) { ob_debug("net_wm_moveresize for 0x%lx direction %d", - client->window, e->xclient.data.l[2]); + client->w_client, e->xclient.data.l[2]); if ((Atom)e->xclient.data.l[2] == OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOPLEFT) || (Atom)e->xclient.data.l[2] == @@ -1472,7 +1472,7 @@ static void event_handle_client(ObClient *client, XEvent *e) if (!client_validate(client)) break; /* compress changes to a single property into a single change */ - while (XCheckTypedWindowEvent(obt_display, client->window, + while (XCheckTypedWindowEvent(obt_display, client->w_client, e->type, &ce)) { Atom a, b; @@ -1546,7 +1546,7 @@ static void event_handle_client(ObClient *client, XEvent *e) else if (msgtype == OBT_PROP_ATOM(NET_WM_USER_TIME)) { guint32 t; if (client == focus_client && - OBT_PROP_GET32(client->window, NET_WM_USER_TIME, CARDINAL, &t) + OBT_PROP_GET32(client->w_client, NET_WM_USER_TIME, CARDINAL, &t) && t && !event_time_after(t, e->xproperty.time) && (!event_last_user_time || event_time_after(t, event_last_user_time))) diff --git a/openbox/focus.c b/openbox/focus.c index cff81bfb..5524d676 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -74,7 +74,7 @@ void focus_set_client(ObClient *client) Window active; ob_debug_type(OB_DEBUG_FOCUS, - "focus_set_client 0x%lx", client ? client->window : 0); + "focus_set_client 0x%lx", client ? client->w_client : 0); if (focus_client == client) return; @@ -98,7 +98,7 @@ void focus_set_client(ObClient *client) /* set the NET_ACTIVE_WINDOW hint, but preserve it on shutdown */ if (ob_state() != OB_STATE_EXITING) { - active = client ? client->window : None; + active = client ? client->w_client : None; OBT_PROP_SET32(obt_root(ob_screen), NET_ACTIVE_WINDOW, WINDOW, active); } } diff --git a/openbox/mouse.c b/openbox/mouse.c index bed0fcb6..54a2a411 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -121,7 +121,7 @@ void mouse_grab_for_client(ObClient *client, gboolean grab) mode = GrabModeAsync; mask = ButtonPressMask | ButtonMotionMask | ButtonReleaseMask; } else if (CLIENT_CONTEXT(i, client)) { - win = client->window; + win = client->w_client; mode = GrabModeSync; /* this is handled in event */ mask = ButtonPressMask; /* can't catch more than this with Sync mode the release event is diff --git a/openbox/moveresize.c b/openbox/moveresize.c index 91eb7bb6..fb27ec29 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -391,14 +391,14 @@ static void do_resize(void) ce.xclient.type = ClientMessage; ce.xclient.message_type = OBT_PROP_ATOM(WM_PROTOCOLS); ce.xclient.display = obt_display; - ce.xclient.window = moveresize_client->window; + ce.xclient.window = moveresize_client->w_client; ce.xclient.format = 32; ce.xclient.data.l[0] = OBT_PROP_ATOM(NET_WM_SYNC_REQUEST); ce.xclient.data.l[1] = event_curtime; ce.xclient.data.l[2] = XSyncValueLow32(val); ce.xclient.data.l[3] = XSyncValueHigh32(val); ce.xclient.data.l[4] = 0l; - XSendEvent(obt_display, moveresize_client->window, FALSE, + XSendEvent(obt_display, moveresize_client->w_client, FALSE, NoEventMask, &ce); waiting_for_sync = TRUE; diff --git a/openbox/ping.c b/openbox/ping.c index 42487ab0..5f1edf41 100644 --- a/openbox/ping.c +++ b/openbox/ping.c @@ -132,8 +132,8 @@ static void ping_send(ObPingTarget *t) } /*ob_debug("+PING: '%s' (id %u)", t->client->title, t->id);*/ - OBT_PROP_MSG_TO(t->client->window, t->client->window, WM_PROTOCOLS, - OBT_PROP_ATOM(NET_WM_PING), t->id, t->client->window, 0, 0, + OBT_PROP_MSG_TO(t->client->w_client, t->client->w_client, WM_PROTOCOLS, + OBT_PROP_ATOM(NET_WM_PING), t->id, t->client->w_client, 0, 0, NoEventMask); } diff --git a/openbox/prompt.c b/openbox/prompt.c index aa5eb06f..63f030ef 100644 --- a/openbox/prompt.c +++ b/openbox/prompt.c @@ -356,7 +356,7 @@ void prompt_show(ObPrompt *self, ObClient *parent) XSetWMNormalHints(obt_display, self->super.window, &hints); XSetTransientForHint(obt_display, self->super.window, - (parent ? parent->window : 0)); + (parent ? parent->w_client : 0)); /* set up the dialog and render it */ prompt_layout(self); diff --git a/openbox/stacking.c b/openbox/stacking.c index d9e8d40d..0f86947f 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -51,7 +51,7 @@ void stacking_set_list(void) windows = g_new(Window, g_list_length(stacking_list)); for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) { if (WINDOW_IS_CLIENT(it->data)) - windows[i++] = WINDOW_AS_CLIENT(it->data)->window; + windows[i++] = WINDOW_AS_CLIENT(it->data)->w_client; } }