/* adjust the frame to the client's size before showing or placing
the window */
frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
- frame_adjust_client_area(self->frame);
/* where the frame was placed is where the window was originally */
placex = self->area.x;
g_free(settings);
ob_debug("Managed window 0x%lx plate 0x%x (%s)\n",
- window, self->frame->plate, self->class);
+ window, self->frame->window, self->class);
return;
}
GSList *it;
ob_debug("Unmanaging window: 0x%x plate 0x%x (%s) (%s)\n",
- self->window, self->frame->plate,
+ self->window, self->frame->window,
self->class, self->title ? self->title : "");
g_assert(self != NULL);
/* if the client is enlarging, then resize the client before the frame */
if (send_resize_client && (w > oldw || h > oldh)) {
XWindowChanges changes;
- changes.x = -self->border_width;
- changes.y = -self->border_width;
+ changes.x = self->frame->size.left - self->border_width;
+ changes.y = self->frame->size.top -self->border_width;
changes.width = MAX(w, oldw);
changes.height = MAX(h, oldh);
changes.border_width = self->border_width;
XConfigureWindow(ob_display, self->window,
CWX|CWY|CWWidth|CWHeight|CWBorderWidth,
&changes);
- /* resize the plate to show the client padding color underneath */
- frame_adjust_client_area(self->frame);
}
/* find the frame's dimensions and move/resize it */
/* if the client is shrinking, then resize the frame before the client */
if (send_resize_client && (w <= oldw && h <= oldh)) {
- /* resize the plate to show the client padding color underneath */
- frame_adjust_client_area(self->frame);
-
if (send_resize_client) {
XWindowChanges changes;
- changes.x = -self->border_width;
- changes.y = -self->border_width;
+ changes.x = self->frame->size.left - self->border_width;
+ changes.y = self->frame->size.top -self->border_width;
changes.width = w;
changes.height = h;
changes.border_width = self->border_width;
#include "screen.h"
#include "render/theme.h"
-#define PLATE_EVENTMASK (SubstructureRedirectMask | FocusChangeMask)
#define FRAME_EVENTMASK (EnterWindowMask | LeaveWindowMask | \
- ButtonPressMask | ButtonReleaseMask)
+ ButtonPressMask | ButtonReleaseMask | \
+ SubstructureRedirectMask | FocusChangeMask)
#define ELEMENT_EVENTMASK (ButtonPressMask | ButtonReleaseMask | \
ButtonMotionMask | PointerMotionMask | \
EnterWindowMask | LeaveWindowMask)
/* create the non-visible decor windows */
- mask = CWEventMask;
+ mask = 0;
if (visual) {
/* client has a 32-bit visual */
mask |= CWColormap | CWBackPixel | CWBorderPixel;
attrib.background_pixel = BlackPixel(ob_display, ob_screen);
attrib.border_pixel = BlackPixel(ob_display, ob_screen);
}
- attrib.event_mask = FRAME_EVENTMASK;
self->window = createWindow(RootWindow(ob_display, ob_screen), visual,
mask, &attrib);
- mask &= ~CWEventMask;
- self->plate = createWindow(self->window, visual, mask, &attrib);
-
/* create the visible decor windows */
mask = CWEventMask;
self->focused = FALSE;
/* the other stuff is shown based on decor settings */
- XMapWindow(ob_display, self->plate);
XMapWindow(ob_display, self->label);
self->max_press = self->close_press = self->desk_press =
} else
XUnmapWindow(ob_display, self->right);
- /* move the plate */
- XMoveWindow(ob_display, self->plate,
- self->size.left, self->size.top);
-
/* when the client has StaticGravity, it likes to move around. */
XMoveWindow(ob_display, self->client->window,
- -self->client->border_width,
- -self->client->border_width);
+ self->size.left - self->client->border_width,
+ self->size.top - self->client->border_width);
}
}
}
}
-void frame_adjust_client_area(ObFrame *self)
-{
- /* resize the plate */
- XResizeWindow(ob_display, self->plate,
- self->client->area.width, self->client->area.height);
-}
-
void frame_adjust_state(ObFrame *self)
{
framerender_frame(self);
*/
/* reparent the client to the frame */
- XReparentWindow(ob_display, self->client->window, self->plate,
- -self->client->border_width, -self->client->border_width);
+ XReparentWindow(ob_display, self->client->window, self->window, 0, 0);
/*
When reparenting the client window, it is usually not mapped yet, since
/* select the event mask on the client's parent (to receive config/map
req's) the ButtonPress is to catch clicks on the client border */
- XSelectInput(ob_display, self->plate, PLATE_EVENTMASK);
+ XSelectInput(ob_display, self->window, FRAME_EVENTMASK);
/* set all the windows for the frame in the window_map */
g_hash_table_insert(window_map, &self->window, self->client);
- g_hash_table_insert(window_map, &self->plate, self->client);
g_hash_table_insert(window_map, &self->innerleft, self->client);
g_hash_table_insert(window_map, &self->innertop, self->client);
g_hash_table_insert(window_map, &self->innerright, self->client);
Reparent events that are generated by us are just discarded here.
They are of no consequence to us anyhow.
*/
- if (ev.xreparent.parent != self->plate) {
+ if (ev.xreparent.parent != self->window) {
reparent = FALSE;
XPutBackEvent(ob_display, &ev);
break;
/* remove all the windows for the frame from the window_map */
g_hash_table_remove(window_map, &self->window);
- g_hash_table_remove(window_map, &self->plate);
g_hash_table_remove(window_map, &self->innerleft);
g_hash_table_remove(window_map, &self->innertop);
g_hash_table_remove(window_map, &self->innerright);
}
self = client->frame;
- if (win == self->plate) {
- /* conceptually, this is the desktop, as far as users are
- concerned */
- if (client->type == OB_CLIENT_TYPE_DESKTOP)
- return OB_FRAME_CONTEXT_DESKTOP;
- return OB_FRAME_CONTEXT_CLIENT;
- }
/* when the user clicks in the corners of the titlebar and the client
is fully maximized, then treat it like they clicked in the