/* frame_release_client */
typedef void EngineFrameReleaseClient(Frame *self, Client *client);
-/* frame_adjust_size */
-/*! Update the frame's size to match the client */
-typedef void EngineFrameAdjustSize(Frame *self);
-/* frame_adjust_position */
-/*! Update the frame's position to match the client */
-typedef void EngineFrameAdjustPosition(Frame *self);
+/* frame_adjust_area */
+/*! Update the frame's size/position to match the client */
+typedef void EngineFrameAdjustArea(Frame *self);
/* frame_adjust_shape */
/*! Shape the frame window to the client window */
typedef void EngineFrameAdjustShape(Frame *self);
#endif
}
-void frame_adjust_size(ObFrame *self)
+void frame_adjust_area(ObFrame *self)
{
if (self->frame.client->decorations & Decor_Border) {
self->bwidth = s_bwidth;
XMapWindow(ob_display, self->handle);
} else
XUnmapWindow(ob_display, self->handle);
-
- XResizeWindow(ob_display, self->frame.window, self->width,
- (self->frame.client->shaded ? TITLE_HEIGHT :
- self->innersize.top + self->innersize.bottom +
- self->frame.client->area.height));
+
+ /* find the new coordinates */
+ self->frame.area.x = self->frame.client->area.x;
+ self->frame.area.y = self->frame.client->area.y;
+ frame_client_gravity((Frame*)self,
+ &self->frame.area.x, &self->frame.area.y);
+ /* move and resize the top level frame */
+ XMoveResizeWindow(ob_display, self->frame.window,
+ self->frame.area.x, self->frame.area.y,
+ self->width,
+ (self->frame.client->shaded ? TITLE_HEIGHT :
+ self->innersize.top + self->innersize.bottom +
+ self->frame.client->area.height));
/* do this in two steps because clients whose gravity is set to
'Static' don't end up getting moved at all with an XMoveResizeWindow */
frame_adjust_shape(self);
}
-void frame_adjust_position(ObFrame *self)
-{
- self->frame.area.x = self->frame.client->area.x;
- self->frame.area.y = self->frame.client->area.y;
- frame_client_gravity((Frame*)self,
- &self->frame.area.x, &self->frame.area.y);
- XMoveWindow(ob_display, self->frame.window,
- self->frame.area.x, self->frame.area.y);
-}
-
void frame_adjust_state(ObFrame *self)
{
render_max(self);
/* map the client so it maps when the frame does */
XMapWindow(ob_display, client->window);
- frame_adjust_size(self);
- frame_adjust_position(self);
+ frame_adjust_area(self);
/* set all the windows for the frame in the client_map */
g_hash_table_insert(client_map, (gpointer)self->frame.window, client);
client_change_allowed_actions(self);
if (self->frame) {
- /* change the decors on the frame */
- engine_frame_adjust_size(self->frame);
- /* with more/less decorations, we may need to be repositioned */
- engine_frame_adjust_position(self->frame);
+ /* change the decors on the frame, and with more/less decorations,
+ we may also need to be repositioned */
+ engine_frame_adjust_area(self->frame);
/* with new decor, the window's maximized size may change */
client_remaximize(self);
}
/* move/resize the frame to match the request */
if (self->frame) {
- /* Adjust the size and then the position, as required by the EWMH */
- if (resized)
- engine_frame_adjust_size(self->frame);
- if (moved) {
- engine_frame_adjust_position(self->frame);
+ engine_frame_adjust_area(self->frame);
+ if (moved) {
if (!user || final) {
XEvent event;
event.type = ConfigureNotify;
self->wmstate = shade ? IconicState : NormalState;
self->shaded = shade;
client_change_state(self);
- engine_frame_adjust_size(self->frame);
+ /* resize the frame to just the titlebar */
+ engine_frame_adjust_area(self->frame);
}
void client_close(Client *self)
LOADSYM(frame_new, engine_frame_new);
LOADSYM(frame_grab_client, engine_frame_grab_client);
LOADSYM(frame_release_client, engine_frame_release_client);
- LOADSYM(frame_adjust_size, engine_frame_adjust_size);
- LOADSYM(frame_adjust_position, engine_frame_adjust_position);
+ LOADSYM(frame_adjust_area, engine_frame_adjust_area);
LOADSYM(frame_adjust_shape, engine_frame_adjust_shape);
LOADSYM(frame_adjust_state, engine_frame_adjust_state);
LOADSYM(frame_adjust_focus, engine_frame_adjust_focus);
EngineFrameGrabClient *engine_frame_grab_client;
EngineFrameReleaseClient *engine_frame_release_client;
-EngineFrameAdjustSize *engine_frame_adjust_size;
-EngineFrameAdjustPosition *engine_frame_adjust_position;
+EngineFrameAdjustArea *engine_frame_adjust_area;
EngineFrameAdjustShape *engine_frame_adjust_shape;
EngineFrameAdjustState *engine_frame_adjust_state;
EngineFrameAdjustFocus *engine_frame_adjust_focus;