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);
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;
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 */
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);
XDestroyWindow(obp_display, OBDEFAULTFRAME(self)->window);
if (OBDEFAULTFRAME(self)->colormap)
XFreeColormap(obp_display, OBDEFAULTFRAME(self)->colormap);
-
+
g_free(OBDEFAULTFRAME(self)->stitle);
g_free(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);
}
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 {
XShapeCombineShape(obp_display, self->window, ShapeBounding,
self->size.left,
self->size.top,
- self->client->window,
+ self->client->w_client,
ShapeBounding, ShapeSet);
num = 0;
*/
/* 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
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
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);
}
/* 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);
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);
}
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);
}
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);
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);
}
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);
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);
- 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
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);
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);
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);
}
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);
/* 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);
}
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);
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);
frame_iconify_animating, /* */
frame_set_decorations, /* */
-
+
frame_update_title, /* */
/* This give the window area */
frame_get_window_area, /* */
/* 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;
Window window;
gchar * stitle; /* The current title we draw */
-
+
gboolean visible;
gboolean max_horz; /* when maxed some decorations are hidden */
/* 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);
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);
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);
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;
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 */
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
}
/* 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 */
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",
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) {
/* 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))
/* 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
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);
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)
/* 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);
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 */
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);
}
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);
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;
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,
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);
{
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
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))
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);
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));
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];
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))
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) {
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 */
{
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
{
XWindowAttributes wa;
- if (XGetWindowAttributes(obt_display, self->window, &wa))
+ if (XGetWindowAttributes(obt_display, self->w_client, &wa))
client_update_colormap(self, wa.colormap);
}
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))
*/
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
/* 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)
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:
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) {
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) {
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;
}
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) {
}
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;
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;
} 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);
(((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);
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)
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 */
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 */
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]) {
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;
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 */
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];
/* 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;
}
}
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);
}
}
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);
*/
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);
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
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);
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
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);
/* 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;
}
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);
}
}
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);
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;
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 */
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);
}
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);
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 */
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)
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);
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;
}
"%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 &&
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,
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);
}
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--;
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:
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
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
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
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)
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"))));
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] ==
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;
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)))
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;
/* 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);
}
}
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
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;
}
/*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);
}
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);
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;
}
}