- switch (e->xconfigurerequest.detail) {
- case Below:
- ob_debug("ConfigureRequest Below for client %s sibling %s\n",
- client->title, sibling ? sibling->title : "(all)");
- /* just lower it */
- stacking_lower(CLIENT_AS_WINDOW(client));
- break;
- case BottomIf:
- ob_debug("ConfigureRequest BottomIf for client %s sibling "
- "%s\n",
- client->title, sibling ? sibling->title : "(all)");
- /* if this client occludes sibling (or anything if NULL), then
- lower it to the bottom */
- if (stacking_occluded(sibling, client))
- stacking_lower(CLIENT_AS_WINDOW(client));
- break;
- case Above:
- ob_debug("ConfigureRequest Above for client %s sibling %s\n",
- client->title, sibling ? sibling->title : "(all)");
- /* activate it rather than just focus it */
- client_activate(client, FALSE, FALSE);
- break;
- case TopIf:
- ob_debug("ConfigureRequest TopIf for client %s sibling %s\n",
- client->title, sibling ? sibling->title : "(all)");
- if (stacking_occluded(client, sibling))
- /* activate it rather than just focus it */
- client_activate(client, FALSE, FALSE);
- case Opposite:
- ob_debug("ConfigureRequest Opposite for client %s sibling "
- "%s\n",
- client->title, sibling ? sibling->title : "(all)");
- if (stacking_occluded(client, sibling))
- /* activate it rather than just focus it */
- client_activate(client, FALSE, FALSE);
- else if (stacking_occluded(sibling, client))
- stacking_lower(CLIENT_AS_WINDOW(client));
- default:
- break;
+ if (ok) {
+ if (!config_focus_under_mouse)
+ ignore_start = event_start_ignore_all_enters();
+ stacking_restack_request(client, sibling,
+ e->xconfigurerequest.detail);
+ if (!config_focus_under_mouse)
+ event_end_ignore_all_enters(ignore_start);
+ }
+
+ /* a stacking change moves the window without resizing */
+ move = TRUE;
+ }
+
+ if ((e->xconfigurerequest.value_mask & CWX) ||
+ (e->xconfigurerequest.value_mask & CWY) ||
+ (e->xconfigurerequest.value_mask & CWWidth) ||
+ (e->xconfigurerequest.value_mask & CWHeight))
+ {
+ /* don't allow clients to move shaded windows (fvwm does this)
+ */
+ if (e->xconfigurerequest.value_mask & CWX) {
+ if (!client->shaded)
+ x = e->xconfigurerequest.x;
+ move = TRUE;
+ }
+ if (e->xconfigurerequest.value_mask & CWY) {
+ if (!client->shaded)
+ y = e->xconfigurerequest.y;
+ move = TRUE;
+ }
+
+ if (e->xconfigurerequest.value_mask & CWWidth) {
+ w = e->xconfigurerequest.width;
+ resize = TRUE;
+ }
+ if (e->xconfigurerequest.value_mask & CWHeight) {
+ h = e->xconfigurerequest.height;
+ resize = TRUE;
+ }
+ }
+
+ ob_debug("ConfigureRequest x(%d) %d y(%d) %d w(%d) %d h(%d) %d "
+ "move %d resize %d",
+ e->xconfigurerequest.value_mask & CWX, x,
+ e->xconfigurerequest.value_mask & CWY, y,
+ e->xconfigurerequest.value_mask & CWWidth, w,
+ e->xconfigurerequest.value_mask & CWHeight, h,
+ move, resize);
+
+ /* check for broken apps moving to their root position
+
+ XXX remove this some day...that would be nice. right now all
+ kde apps do this when they try activate themselves on another
+ desktop. eg. open amarok window on desktop 1, switch to desktop
+ 2, click amarok tray icon. it will move by its decoration size.
+ */
+ if (x != client->area.x &&
+ x == (client->frame->area.x + client->frame->size.left -
+ (gint)client->border_width) &&
+ y != client->area.y &&
+ y == (client->frame->area.y + client->frame->size.top -
+ (gint)client->border_width) &&
+ w == client->area.width &&
+ h == client->area.height)
+ {
+ ob_debug_type(OB_DEBUG_APP_BUGS,
+ "Application %s is trying to move via "
+ "ConfigureRequest to it's root window position "
+ "but it is not using StaticGravity",
+ client->title);
+ /* don't move it */
+ x = client->area.x;
+ y = client->area.y;
+
+ /* they still requested a move, so don't change whether a
+ notify is sent or not */
+ }
+
+ /* check for broken apps (java swing) moving to 0,0 when there is a
+ strut there.
+
+ XXX remove this some day...that would be nice. but really unexpected
+ from Sun Microsystems.
+ */
+ if (x == 0 && y == 0 && client->gravity == NorthWestGravity &&
+ client_normal(client))
+ {
+ const Rect to = { x, y, w, h };
+
+ /* oldschool fullscreen windows are allowed */
+ if (!client_is_oldfullscreen(client, &to)) {
+ Rect *r;
+
+ r = screen_area(client->desktop, SCREEN_AREA_ALL_MONITORS,
+ NULL);
+ if (r->x || r->y) {
+ /* move the window only to the corner outside struts */
+ x = r->x;
+ y = r->y;
+
+ ob_debug_type(OB_DEBUG_APP_BUGS,
+ "Application %s is trying to move via "
+ "ConfigureRequest to 0,0 using "
+ "NorthWestGravity, while there is a "
+ "strut there. "
+ "Moving buggy app from (0,0) to (%d,%d)",
+ client->title, r->x, r->y);
+ }
+
+ g_slice_free(Rect, r);
+
+ /* they still requested a move, so don't change whether a
+ notify is sent or not */