grab_server(FALSE);
- /* add to client list/map */
- client_list = g_list_append(client_list, self);
- g_hash_table_insert(window_map, &self->window, self);
-
/* update the focus lists */
focus_order_add_new(self);
dispatch_client(Event_Client_Mapped, self, 0, 0);
+ /* add to client list/map */
+ client_list = g_list_append(client_list, self);
+ g_hash_table_insert(window_map, &self->window, self);
+
ob_debug("Managed window 0x%lx (%s)\n", window, self->class);
}
unmapping/mapping */
PROP_ERASE(self->window, net_wm_desktop);
PROP_ERASE(self->window, net_wm_state);
+ PROP_ERASE(self->window, wm_state);
} else {
/* if we're left in an iconic state, the client wont be mapped. this is
bad, since we will no longer be managing the window on restart */
if (!PROP_GETA32(self->window, net_wm_strut, cardinal, &data, &num)) {
STRUT_SET(self->strut, 0, 0, 0, 0);
} else {
- if (num == 4) {
- g_message("new strut: %d %d %d %d",
- data[0], data[2], data[1], data[3]);
+ if (num == 4)
STRUT_SET(self->strut, data[0], data[2], data[1], data[3]);
- }
else
STRUT_SET(self->strut, 0, 0, 0, 0);
g_free(data);
*/
}
-void client_configure(ObClient *self, ObCorner anchor,
- int x, int y, int w, int h,
- gboolean user, gboolean final)
+void client_configure_full(ObClient *self, ObCorner anchor,
+ int x, int y, int w, int h,
+ gboolean user, gboolean final,
+ gboolean force_reply)
{
gboolean moved = FALSE, resized = FALSE;
if (moved || resized)
frame_adjust_area(self->frame, moved, resized);
- /* If you send this and the client hasn't changed you end up with buggy
- clients (emacs) freaking out, cuz they send back a configure every
- time they receive this event, which resends them this event... etc.
- */
- if ((!user && moved) || (user && final)) {
+ if (force_reply || (!resized && ((!user && moved) || (user && final))))
+ {
XEvent event;
event.type = ConfigureNotify;
event.xconfigure.display = ob_display;
event.xconfigure.event = self->window;
event.xconfigure.window = self->window;
-
+
/* root window real coords */
- event.xconfigure.x = self->frame->area.x + self->frame->size.left;
- event.xconfigure.y = self->frame->area.y + self->frame->size.top;
+ event.xconfigure.x = self->frame->area.x + self->frame->size.left -
+ self->border_width;
+ event.xconfigure.y = self->frame->area.y + self->frame->size.top -
+ self->border_width;
event.xconfigure.width = w;
event.xconfigure.height = h;
/* Returns if the window is focused */
gboolean client_focused(ObClient *self);
+#define client_configure(self, anchor, x, y, w, h, user, final) \
+ client_configure_full(self, anchor, x, y, w, h, user, final, FALSE)
+
/*! Move and/or resize the window.
This also maintains things like the client's minsize, and size increments.
@param anchor The corner to keep in the same position when resizing.
configuration. e.g. Final should be FALSE if doing an
interactive move/resize, and then be TRUE for the last call
only.
+ @param force_reply Send a ConfigureNotify to the client regardless of if
+ the position changed.
*/
-void client_configure(ObClient *self, ObCorner anchor,
- int x, int y, int w, int h,
- gboolean user, gboolean final);
+void client_configure_full(ObClient *self, ObCorner anchor,
+ int x, int y, int w, int h,
+ gboolean user, gboolean final,
+ gboolean force_reply);
void client_reconfigure(ObClient *self);
/* if we are iconic (or shaded (fvwm does this)) ignore the event */
if (client->iconic || client->shaded) return;
- if (e->xconfigurerequest.value_mask & CWBorderWidth)
- client->border_width = e->xconfigurerequest.border_width;
-
/* resize, then move, as specified in the EWMH section 7.7 */
if (e->xconfigurerequest.value_mask & (CWWidth | CWHeight |
- CWX | CWY)) {
+ CWX | CWY |
+ CWBorderWidth)) {
int x, y, w, h;
ObCorner corner;
+ if (e->xconfigurerequest.value_mask & CWBorderWidth)
+ client->border_width = e->xconfigurerequest.border_width;
+
x = (e->xconfigurerequest.value_mask & CWX) ?
e->xconfigurerequest.x : client->area.x;
y = (e->xconfigurerequest.value_mask & CWY) ?
corner = OB_CORNER_TOPLEFT;
}
- client_configure(client, corner, x, y, w, h, FALSE, TRUE);
+ client_configure_full(client, corner, x, y, w, h, FALSE, TRUE,
+ TRUE);
}
if (e->xconfigurerequest.value_mask & CWStackMode) {
client_setup_decor_and_functions(client);
}
else if (msgtype == prop_atoms.net_wm_strut) {
- g_message("strut change");
client_update_strut(client);
}
else if (msgtype == prop_atoms.net_wm_icon ||