From: Dana Jansens Date: Sat, 5 May 2007 22:28:32 +0000 (+0000) Subject: merge r6080-6085 from trunk X-Git-Tag: openbox-3_3_991-RELEASE~159 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=6b02670de9eec1f67741716098f4f4db21a2f99e;p=dana%2Fopenbox.git merge r6080-6085 from trunk --- diff --git a/openbox/action.c b/openbox/action.c index 2e348c7c..797552f6 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -1263,9 +1263,9 @@ void action_raiselower(union ActionData *data) if (cit == c) break; if (client_normal(cit) == client_normal(c) && - cit->layer == c->layer && - frame_visible(cit->frame) && - !client_search_transient(c, cit)) + cit->layer == c->layer && + cit->frame->visible && + !client_search_transient(c, cit)) { if (RECT_INTERSECTS_RECT(cit->frame->area, c->frame->area)) { raise = TRUE; diff --git a/openbox/client.c b/openbox/client.c index 02bd74b4..9327cbfd 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1103,7 +1103,7 @@ static void client_get_state(ObClient *self) self->below = TRUE; else if (state[i] == prop_atoms.net_wm_state_demands_attention) self->demands_attention = TRUE; - else if (state[i] == prop_atoms.ob_wm_state_undecorated) + else if (state[i] == prop_atoms.openbox_wm_state_undecorated) self->undecorated = TRUE; } @@ -1266,7 +1266,7 @@ static void client_update_transient_tree(ObClient *self, c = it->data; if (c != self && (!c->transient_for || c->transient_for != OB_TRAN_GROUP)) - c->transients = g_slist_append(c->transients, self); + c->transients = g_slist_prepend(c->transients, self); } } /* If we are now transient for a single window which we weren't before, @@ -1279,7 +1279,7 @@ static void client_update_transient_tree(ObClient *self, newparent != oldparent && /* don't make ourself its child if it is already our child */ !client_is_direct_child(self, newparent)) - newparent->transients = g_slist_append(newparent->transients, self); + newparent->transients = g_slist_prepend(newparent->transients, self); /* If the group changed then we need to add any new group transient windows to our children. But if we're transient for the group, then @@ -1298,7 +1298,7 @@ static void client_update_transient_tree(ObClient *self, /* Don't make it our child if it is already our parent */ !client_is_direct_child(c, self)) { - self->transients = g_slist_append(self->transients, c); + self->transients = g_slist_prepend(self->transients, c); } } } @@ -2061,7 +2061,7 @@ static void client_change_wm_state(ObClient *self) old = self->wmstate; - if (self->shaded || self->iconic || !frame_visible(self->frame)) + if (self->shaded || !self->frame->visible) self->wmstate = IconicState; else self->wmstate = NormalState; @@ -2105,7 +2105,7 @@ static void client_change_state(ObClient *self) if (self->demands_attention) netstate[num++] = prop_atoms.net_wm_state_demands_attention; if (self->undecorated) - netstate[num++] = prop_atoms.ob_wm_state_undecorated; + netstate[num++] = prop_atoms.openbox_wm_state_undecorated; PROP_SETA32(self->window, net_wm_state, atom, netstate, num); if (self->frame) @@ -2724,27 +2724,10 @@ static void client_iconify_recursive(ObClient *self, if (changed) { client_change_state(self); - if (iconic) { - if (ob_state() != OB_STATE_STARTING && config_animate_iconify) { - /* delay the showhide until the window is done the animation */ - frame_begin_iconify_animation - (self->frame, iconic, - (ObFrameIconifyAnimateFunc)client_showhide, self); - /* but focus a new window now please */ - focus_fallback(FALSE); - } else - client_showhide(self); - } else { - if (config_animate_iconify) - /* the animation will show the window when it is hidden, - but the window state needs to be adjusted after the - animation finishes, so call showhide when it's done to make - sure everything is updated appropriately - */ - frame_begin_iconify_animation - (self->frame, iconic, - (ObFrameIconifyAnimateFunc)client_showhide, self); - } + if (ob_state() != OB_STATE_STARTING && config_animate_iconify) + frame_begin_iconify_animation(self->frame, iconic); + /* do this after starting the animation so it doesn't flash */ + client_showhide(self); } /* iconify all direct transients, and deiconify all transients @@ -3070,7 +3053,7 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2) action = self->demands_attention ? prop_atoms.net_wm_state_remove : prop_atoms.net_wm_state_add; - else if (state == prop_atoms.ob_wm_state_undecorated) + else if (state == prop_atoms.openbox_wm_state_undecorated) action = undecorated ? prop_atoms.net_wm_state_remove : prop_atoms.net_wm_state_add; } @@ -3100,7 +3083,7 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2) self->below = TRUE; } else if (state == prop_atoms.net_wm_state_demands_attention) { demands_attention = TRUE; - } else if (state == prop_atoms.ob_wm_state_undecorated) { + } else if (state == prop_atoms.openbox_wm_state_undecorated) { undecorated = TRUE; } @@ -3127,7 +3110,7 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2) self->below = FALSE; } else if (state == prop_atoms.net_wm_state_demands_attention) { demands_attention = FALSE; - } else if (state == prop_atoms.ob_wm_state_undecorated) { + } else if (state == prop_atoms.openbox_wm_state_undecorated) { undecorated = FALSE; } } @@ -3188,7 +3171,7 @@ gboolean client_can_focus(ObClient *self) /* choose the correct target */ self = client_focus_target(self); - if (!frame_visible(self->frame)) + if (!self->frame->visible) return FALSE; if (!(self->can_focus || self->focus_notify)) @@ -3221,7 +3204,7 @@ gboolean client_focus(ObClient *self) self = client_focus_target(self); if (!client_can_focus(self)) { - if (!frame_visible(self->frame)) { + if (!self->frame->visible) { /* update the focus lists */ focus_order_to_top(self); } @@ -3306,7 +3289,7 @@ void client_activate(ObClient *self, gboolean here, gboolean user) client_set_desktop(self, screen_desktop, FALSE); else screen_set_desktop(self->desktop); - } else if (!frame_visible(self->frame)) + } else if (!self->frame->visible) /* if its not visible for other reasons, then don't mess with it */ return; @@ -3733,7 +3716,7 @@ ObClient* client_under_pointer() for (it = stacking_list; it; it = g_list_next(it)) { if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = WINDOW_AS_CLIENT(it->data); - if (frame_visible(c->frame) && + if (c->frame->visible && /* ignore all animating windows */ !frame_iconify_animating(c->frame) && RECT_CONTAINS(c->frame->area, x, y)) diff --git a/openbox/debug.c b/openbox/debug.c index af22c69f..3a765dc5 100644 --- a/openbox/debug.c +++ b/openbox/debug.c @@ -35,6 +35,7 @@ void ob_debug(const gchar *a, ...) va_list vl; if (show) { + fprintf(stderr, "DEBUG: "); va_start(vl, a); vfprintf(stderr, a, vl); va_end(vl); @@ -56,6 +57,17 @@ void ob_debug_type(ObDebugType type, const gchar *a, ...) g_assert(type < OB_DEBUG_TYPE_NUM); if (show && enabled_types[type]) { + switch (type) { + case OB_DEBUG_FOCUS: + fprintf(stderr, "FOCUS: "); + break; + case OB_DEBUG_APP_BUGS: + fprintf(stderr, "APPLICATION BUG: "); + break; + default: + g_assert_not_reached(); + } + va_start(vl, a); vfprintf(stderr, a, vl); va_end(vl); diff --git a/openbox/debug.h b/openbox/debug.h index 2b907ebf..a38ae75b 100644 --- a/openbox/debug.h +++ b/openbox/debug.h @@ -27,6 +27,7 @@ void ob_debug(const gchar *a, ...); typedef enum { OB_DEBUG_FOCUS, + OB_DEBUG_APP_BUGS, OB_DEBUG_TYPE_NUM } ObDebugType; diff --git a/openbox/event.c b/openbox/event.c index ec0789d1..61aea441 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -309,6 +309,9 @@ static gboolean wanted_focusevent(XEvent *e) /* This means focus moved from one client to another */ if (detail == NotifyNonlinearVirtual) return TRUE; + /* This means focus moved to the frame window */ + if (detail == NotifyInferior) + return TRUE; /* Otherwise.. */ return FALSE; @@ -561,7 +564,10 @@ static void event_handle_root(XEvent *e) guint d = e->xclient.data.l[0]; if (d < screen_num_desktops) { event_curtime = e->xclient.data.l[1]; - ob_debug("SWITCH DESKTOP TIME: %d\n", event_curtime); + if (event_curtime == 0) + ob_debug_type(OB_DEBUG_APP_BUGS, + "_NET_CURRENT_DESKTOP message is missing " + "a timestamp\n"); screen_set_desktop(d); } } else if (msgtype == prop_atoms.net_number_of_desktops) { @@ -570,7 +576,7 @@ static void event_handle_root(XEvent *e) screen_set_num_desktops(d); } else if (msgtype == prop_atoms.net_showing_desktop) { screen_show_desktop(e->xclient.data.l[0] != 0, TRUE); - } else if (msgtype == prop_atoms.ob_control) { + } else if (msgtype == prop_atoms.openbox_control) { if (e->xclient.data.l[0] == 1) ob_reconfigure(); else if (e->xclient.data.l[0] == 2) @@ -635,7 +641,6 @@ static void event_handle_client(ObClient *client, XEvent *e) { XEvent ce; Atom msgtype; - gint i=0; ObFrameContext con; switch (e->type) { @@ -787,31 +792,20 @@ static void event_handle_client(ObClient *client, XEvent *e) break; } case ConfigureRequest: - /* compress these */ - while (XCheckTypedWindowEvent(ob_display, client->window, - ConfigureRequest, &ce)) { - ++i; - /* XXX if this causes bad things.. we can compress config req's - with the same mask. */ - e->xconfigurerequest.value_mask |= - ce.xconfigurerequest.value_mask; - if (ce.xconfigurerequest.value_mask & CWX) - e->xconfigurerequest.x = ce.xconfigurerequest.x; - if (ce.xconfigurerequest.value_mask & CWY) - e->xconfigurerequest.y = ce.xconfigurerequest.y; - if (ce.xconfigurerequest.value_mask & CWWidth) - e->xconfigurerequest.width = ce.xconfigurerequest.width; - if (ce.xconfigurerequest.value_mask & CWHeight) - e->xconfigurerequest.height = ce.xconfigurerequest.height; - if (ce.xconfigurerequest.value_mask & CWBorderWidth) - e->xconfigurerequest.border_width = - ce.xconfigurerequest.border_width; - if (ce.xconfigurerequest.value_mask & CWStackMode) - e->xconfigurerequest.detail = ce.xconfigurerequest.detail; - } + /* dont compress these unless you're going to watch for property + notifies in between (these can change what the configure would + do to the window). + also you can't compress stacking events + */ + + ob_debug("ConfigureRequest desktop %d wmstate %d vis %d\n", + screen_desktop, client->wmstate, client->frame->visible); - /* if we are iconic (or shaded (fvwm does this)) ignore the event */ - if (client->iconic || client->shaded) return; + /* don't allow clients to move shaded windows (fvwm does this) */ + if (client->shaded) { + e->xconfigurerequest.value_mask &= ~CWX; + e->xconfigurerequest.value_mask &= ~CWY; + } /* resize, then move, as specified in the EWMH section 7.7 */ if (e->xconfigurerequest.value_mask & (CWWidth | CWHeight | @@ -835,6 +829,30 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xconfigurerequest.value_mask & CWX, x, e->xconfigurerequest.value_mask & CWY, y); + /* 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)) + { + 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\n", + client->title); + /* don't move it */ + x = client->area.x; + y = client->area.y; + } + client_find_onscreen(client, &x, &y, w, h, FALSE); client_configure_full(client, x, y, w, h, FALSE, TRUE, TRUE); } @@ -957,8 +975,11 @@ static void event_handle_client(ObClient *client, XEvent *e) (e->xclient.data.l[0] == 0 ? "unknown" : (e->xclient.data.l[0] == 1 ? "application" : (e->xclient.data.l[0] == 2 ? "user" : "INVALID")))); - /* XXX make use of data.l[2] ! */ + /* XXX make use of data.l[2] !? */ event_curtime = e->xclient.data.l[1]; + ob_debug_type(OB_DEBUG_APP_BUGS, + "_NET_ACTIVE_WINDOW message for window %s is " + "missing a timestamp\n", client->title); client_activate(client, FALSE, (e->xclient.data.l[0] == 0 || e->xclient.data.l[0] == 2)); @@ -1386,7 +1407,7 @@ static void event_handle_user_input(ObClient *client, XEvent *e) { /* the frame may not be "visible" but they can still click on it in the case where it is animating before disappearing */ - if (client && frame_visible(client->frame)) + if (!client || !frame_iconify_animating(client->frame)) mouse_event(client, e); } else if (e->type == KeyPress) { keyboard_event((focus_cycle_target ? focus_cycle_target : diff --git a/openbox/frame.c b/openbox/frame.c index a5a07609..0ea6e75a 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -258,11 +258,12 @@ void frame_hide(ObFrame *self) { if (self->visible) { self->visible = FALSE; - self->client->ignore_unmaps += 1; + if (!frame_iconify_animating(self)) + XUnmapWindow(ob_display, self->window); /* we unmap the client itself so that we can get MapRequest events, and because the ICCCM tells us to! */ - XUnmapWindow(ob_display, self->window); XUnmapWindow(ob_display, self->client->window); + self->client->ignore_unmaps += 1; } } @@ -507,6 +508,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved, vals[3] = self->size.bottom; PROP_SETA32(self->client->window, net_frame_extents, cardinal, vals, 4); + PROP_SETA32(self->client->window, kde_net_wm_frame_strut, + cardinal, vals, 4); } /* if this occurs while we are focus cycling, the indicator needs to @@ -1121,13 +1124,12 @@ void frame_end_iconify_animation(ObFrame *self) /* see if there is an animation going */ if (self->iconify_animation_going == 0) return; - /* call the callback when it's done */ - if (self->iconify_animation_cb) - self->iconify_animation_cb(self->iconify_animation_data); + if (!self->visible) + XUnmapWindow(ob_display, self->window); + /* we're not animating any more ! */ self->iconify_animation_going = 0; - /* move after the callback for the animation ending */ XMoveResizeWindow(ob_display, self->window, self->area.x, self->area.y, self->area.width - self->bwidth * 2, @@ -1135,9 +1137,7 @@ void frame_end_iconify_animation(ObFrame *self) XFlush(ob_display); } -void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying, - ObFrameIconifyAnimateFunc callback, - gpointer data) +void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying) { gulong time; gboolean new_anim = FALSE; @@ -1146,10 +1146,8 @@ void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying, /* if there is no titlebar, just don't animate for now XXX it would be nice tho.. */ - if (!(self->decorations & OB_FRAME_DECOR_TITLEBAR)) { - if (callback) callback(data); + if (!(self->decorations & OB_FRAME_DECOR_TITLEBAR)) return; - } /* get the current time */ g_get_current_time(&now); @@ -1167,9 +1165,6 @@ void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying, new_anim = TRUE; self->iconify_animation_going = iconifying ? 1 : -1; - self->iconify_animation_cb = callback; - self->iconify_animation_data = data; - /* set the ending time */ if (set_end) { self->iconify_animation_end.tv_sec = now.tv_sec; @@ -1188,14 +1183,8 @@ void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying, /* do the first step */ frame_animate_iconify(self); + /* show it during the animation even if it is not "visible" */ if (!self->visible) - frame_show(self); + XMapWindow(ob_display, self->window); } } - -gboolean frame_visible(ObFrame *self) -{ - /* if it is animating back from iconic state then it is considered - visible. but if it is iconifying then it is not visible. */ - return self->visible && self->iconify_animation_going <= 0; -} diff --git a/openbox/frame.h b/openbox/frame.h index 5f31b8c9..7be63d53 100644 --- a/openbox/frame.h +++ b/openbox/frame.h @@ -77,9 +77,6 @@ struct _ObFrame Strut size; Rect area; - /*! Is the frame visible? Don't read this directly ! Use frame_visible() - instead, because that takes into account if the frame is visible but - animating to the iconic (invisible) state. */ gboolean visible; guint decorations; @@ -154,8 +151,6 @@ struct _ObFrame */ gint iconify_animation_going; GTimeVal iconify_animation_end; - ObFrameIconifyAnimateFunc iconify_animation_cb; - gpointer iconify_animation_data; }; ObFrame *frame_new(struct _ObClient *c); @@ -195,15 +190,9 @@ void frame_flash_stop(ObFrame *self); /*! Start an animation for iconifying or restoring a frame. The callback will be called when the animation finishes. But if another animation is started in the meantime, the callback will never get called. */ -void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying, - ObFrameIconifyAnimateFunc callback, - gpointer data); +void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying); void frame_end_iconify_animation(ObFrame *self); -/* Returns true if the frame is visible (but false if it is only visible - because it is animating */ -gboolean frame_visible(ObFrame *self); - #define frame_iconify_animating(f) (f->iconify_animation_going != 0) #endif diff --git a/openbox/moveresize.c b/openbox/moveresize.c index 9f9d4dfd..b0b1f2a1 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -153,7 +153,7 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) moving = (cnr == prop_atoms.net_wm_moveresize_move || cnr == prop_atoms.net_wm_moveresize_move_keyboard); - if (moveresize_in_progress || !frame_visible(c->frame) || + if (moveresize_in_progress || !c->frame->visible || !(moving ? (c->functions & OB_CLIENT_FUNC_MOVE) : (c->functions & OB_CLIENT_FUNC_RESIZE))) diff --git a/openbox/openbox.c b/openbox/openbox.c index 052929a5..2cd8958f 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -137,7 +137,7 @@ gint main(gint argc, gchar **argv) * remote_control = 1 -> reconfigure * remote_control = 2 -> restart */ PROP_MSG(RootWindow(ob_display, ob_screen), - ob_control, remote_control, 0, 0, 0); + openbox_control, remote_control, 0, 0, 0); XCloseDisplay(ob_display); exit(EXIT_SUCCESS); } @@ -441,8 +441,10 @@ static void parse_args(gint argc, gchar **argv) xsync = TRUE; } else if (!strcmp(argv[i], "--debug")) { ob_debug_show_output(TRUE); + ob_debug_enable(OB_DEBUG_APP_BUGS, TRUE); } else if (!strcmp(argv[i], "--debug-focus")) { ob_debug_show_output(TRUE); + ob_debug_enable(OB_DEBUG_APP_BUGS, TRUE); ob_debug_enable(OB_DEBUG_FOCUS, TRUE); } else if (!strcmp(argv[i], "--reconfigure")) { remote_control = 1; diff --git a/openbox/place.c b/openbox/place.c index eada385f..ac902d2d 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -251,8 +251,7 @@ typedef enum } ObSmartType; #define SMART_IGNORE(placer, c) \ - (placer == c || c->shaded || !client_normal(c) || \ - !frame_visible(c->frame) || \ + (placer == c || c->shaded || !client_normal(c) || !c->frame->visible || \ (c->desktop != DESKTOP_ALL && \ c->desktop != (placer->desktop == DESKTOP_ALL ? \ screen_desktop : placer->desktop))) diff --git a/openbox/prop.c b/openbox/prop.c index e622c7dd..9f2d48b4 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -64,6 +64,7 @@ void prop_startup() CREATE(net_current_desktop, "_NET_CURRENT_DESKTOP"); CREATE(net_desktop_names, "_NET_DESKTOP_NAMES"); CREATE(net_active_window, "_NET_ACTIVE_WINDOW"); +/* CREATE(net_restack_window, "_NET_RESTACK_WINDOW");*/ CREATE(net_workarea, "_NET_WORKAREA"); CREATE(net_supporting_wm_check, "_NET_SUPPORTING_WM_CHECK"); CREATE(net_desktop_layout, "_NET_DESKTOP_LAYOUT"); @@ -89,6 +90,7 @@ void prop_startup() /* CREATE(net_wm_pid, "_NET_WM_PID"); */ CREATE(net_wm_allowed_actions, "_NET_WM_ALLOWED_ACTIONS"); CREATE(net_wm_user_time, "_NET_WM_USER_TIME"); + CREATE(kde_net_wm_frame_strut, "_KDE_NET_WM_FRAME_STRUT"); CREATE(net_frame_extents, "_NET_FRAME_EXTENTS"); /* CREATE(net_wm_ping, "_NET_WM_PING"); */ @@ -129,7 +131,7 @@ void prop_startup() CREATE(net_wm_action_change_desktop, "_NET_WM_ACTION_CHANGE_DESKTOP"); CREATE(net_wm_action_close, "_NET_WM_ACTION_CLOSE"); CREATE(net_wm_state_modal, "_NET_WM_STATE_MODAL"); - CREATE(net_wm_state_sticky, "_NET_WM_STATE_STICKY"); +/* CREATE(net_wm_state_sticky, "_NET_WM_STATE_STICKY");*/ CREATE(net_wm_state_maximized_vert, "_NET_WM_STATE_MAXIMIZED_VERT"); CREATE(net_wm_state_maximized_horz, "_NET_WM_STATE_MAXIMIZED_HORZ"); CREATE(net_wm_state_shaded, "_NET_WM_STATE_SHADED"); @@ -155,13 +157,15 @@ void prop_startup() CREATE(kde_wm_change_state, "_KDE_WM_CHANGE_STATE"); CREATE(kde_net_wm_window_type_override,"_KDE_NET_WM_WINDOW_TYPE_OVERRIDE"); +/* CREATE(rootpmapid, "_XROOTPMAP_ID"); CREATE(esetrootid, "ESETROOT_PMAP_ID"); +*/ CREATE(openbox_pid, "_OPENBOX_PID"); CREATE(openbox_rc, "_OPENBOX_RC"); - CREATE(ob_wm_state_undecorated, "_OB_WM_STATE_UNDECORATED"); - CREATE(ob_control, "_OB_CONTROL"); + CREATE(openbox_wm_state_undecorated, "_OB_WM_STATE_UNDECORATED"); + CREATE(openbox_control, "_OB_CONTROL"); } #include diff --git a/openbox/prop.h b/openbox/prop.h index 49c342f6..4ae9e775 100644 --- a/openbox/prop.h +++ b/openbox/prop.h @@ -58,7 +58,33 @@ typedef struct Atoms { /* NETWM atoms */ - Atom net_wm_full_placement; + /* Atoms that are used inside messages - these don't go in net_supported */ + + Atom net_wm_moveresize_size_topleft; + Atom net_wm_moveresize_size_top; + Atom net_wm_moveresize_size_topright; + Atom net_wm_moveresize_size_right; + Atom net_wm_moveresize_size_bottomright; + Atom net_wm_moveresize_size_bottom; + Atom net_wm_moveresize_size_bottomleft; + Atom net_wm_moveresize_size_left; + Atom net_wm_moveresize_move; + Atom net_wm_moveresize_size_keyboard; + Atom net_wm_moveresize_move_keyboard; + Atom net_wm_moveresize_cancel; + + Atom net_wm_state_add; + Atom net_wm_state_remove; + Atom net_wm_state_toggle; + + Atom net_wm_orientation_horz; + Atom net_wm_orientation_vert; + Atom net_wm_topleft; + Atom net_wm_topright; + Atom net_wm_bottomright; + Atom net_wm_bottomleft; + + /* Everything below here must go in net_supported on the root window */ /* root window properties */ Atom net_supported; @@ -70,15 +96,20 @@ typedef struct Atoms { Atom net_current_desktop; Atom net_desktop_names; Atom net_active_window; +/* Atom net_restack_window;*/ Atom net_workarea; Atom net_supporting_wm_check; Atom net_desktop_layout; Atom net_showing_desktop; + /* root window messages */ Atom net_close_window; Atom net_wm_moveresize; Atom net_moveresize_window; + /* helpful hints to apps that aren't used for anything */ + Atom net_wm_full_placement; + /* startup-notification extension */ Atom net_startup_id; @@ -115,19 +146,6 @@ typedef struct Atoms { Atom net_wm_window_type_dialog; Atom net_wm_window_type_normal; - Atom net_wm_moveresize_size_topleft; - Atom net_wm_moveresize_size_top; - Atom net_wm_moveresize_size_topright; - Atom net_wm_moveresize_size_right; - Atom net_wm_moveresize_size_bottomright; - Atom net_wm_moveresize_size_bottom; - Atom net_wm_moveresize_size_bottomleft; - Atom net_wm_moveresize_size_left; - Atom net_wm_moveresize_move; - Atom net_wm_moveresize_size_keyboard; - Atom net_wm_moveresize_move_keyboard; - Atom net_wm_moveresize_cancel; - Atom net_wm_action_move; Atom net_wm_action_resize; Atom net_wm_action_minimize; @@ -139,7 +157,7 @@ typedef struct Atoms { Atom net_wm_action_close; Atom net_wm_state_modal; - Atom net_wm_state_sticky; +/* Atom net_wm_state_sticky;*/ Atom net_wm_state_maximized_vert; Atom net_wm_state_maximized_horz; Atom net_wm_state_shaded; @@ -151,31 +169,23 @@ typedef struct Atoms { Atom net_wm_state_below; Atom net_wm_state_demands_attention; - Atom net_wm_state_add; - Atom net_wm_state_remove; - Atom net_wm_state_toggle; - - Atom net_wm_orientation_horz; - Atom net_wm_orientation_vert; - Atom net_wm_topleft; - Atom net_wm_topright; - Atom net_wm_bottomright; - Atom net_wm_bottomleft; - - /* Extra atoms */ + /* KDE atoms */ Atom kde_wm_change_state; + Atom kde_net_wm_frame_strut; Atom kde_net_wm_window_type_override; +/* Atom rootpmapid; Atom esetrootid; +*/ /* Openbox specific atoms */ + Atom openbox_wm_state_undecorated; Atom openbox_pid; Atom openbox_rc; - Atom ob_wm_state_undecorated; - Atom ob_control; + Atom openbox_control; } Atoms; Atoms prop_atoms; diff --git a/openbox/resist.c b/openbox/resist.c index 0c7ec87e..e5d49faa 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -57,7 +57,7 @@ void resist_move_windows(ObClient *c, gint *x, gint *y) target = it->data; /* don't snap to self or non-visibles */ - if (!frame_visible(target->frame) || target == c) continue; + if (!target->frame->visible || target == c) continue; /* don't snap to windows in layers beneath */ if(target->layer < c->layer && !config_resist_layers_below) @@ -199,7 +199,7 @@ void resist_size_windows(ObClient *c, gint *w, gint *h, ObCorner corn) target = it->data; /* don't snap to invisibles or ourself */ - if (!frame_visible(target->frame) || target == c) continue; + if (!target->frame->visible || target == c) continue; /* don't snap to windows in layers beneath */ if(target->layer < c->layer && !config_resist_layers_below) diff --git a/openbox/screen.c b/openbox/screen.c index 8fdbe096..b305e685 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -157,6 +157,7 @@ gboolean screen_annex() XSetWindowAttributes attrib; pid_t pid; gint i, num_support; + Atom *prop_atoms_start, *wm_supported_pos; gulong *supported; /* create the netwm support window */ @@ -205,12 +206,15 @@ gboolean screen_annex() window, screen_support_win); /* set the _NET_SUPPORTED_ATOMS hint */ - num_support = 55; -#ifdef SYNC - num_support += 2; -#endif + + /* this is all the atoms after net_supported in the prop_atoms struct */ + prop_atoms_start = (Atom*)&prop_atoms; + wm_supported_pos = (Atom*)&(prop_atoms.net_supported); + num_support = sizeof(prop_atoms) / sizeof(Atom) - + (wm_supported_pos - prop_atoms_start) - 1; i = 0; supported = g_new(gulong, num_support); + supported[i++] = prop_atoms.net_supporting_wm_check; supported[i++] = prop_atoms.net_wm_full_placement; supported[i++] = prop_atoms.net_current_desktop; supported[i++] = prop_atoms.net_number_of_desktops; @@ -230,6 +234,9 @@ gboolean screen_annex() supported[i++] = prop_atoms.net_wm_visible_icon_name; supported[i++] = prop_atoms.net_wm_desktop; supported[i++] = prop_atoms.net_wm_strut; + supported[i++] = prop_atoms.net_wm_strut_partial; + supported[i++] = prop_atoms.net_wm_icon; + supported[i++] = prop_atoms.net_wm_icon_geometry; supported[i++] = prop_atoms.net_wm_window_type; supported[i++] = prop_atoms.net_wm_window_type_desktop; supported[i++] = prop_atoms.net_wm_window_type_dock; @@ -265,11 +272,20 @@ gboolean screen_annex() supported[i++] = prop_atoms.net_wm_moveresize; supported[i++] = prop_atoms.net_wm_user_time; supported[i++] = prop_atoms.net_frame_extents; + supported[i++] = prop_atoms.net_startup_id; #ifdef SYNC supported[i++] = prop_atoms.net_wm_sync_request; supported[i++] = prop_atoms.net_wm_sync_request_counter; #endif - supported[i++] = prop_atoms.ob_wm_state_undecorated; + + supported[i++] = prop_atoms.kde_wm_change_state; + supported[i++] = prop_atoms.kde_net_wm_frame_strut; + supported[i++] = prop_atoms.kde_net_wm_window_type_override; + + supported[i++] = prop_atoms.openbox_wm_state_undecorated; + supported[i++] = prop_atoms.openbox_pid; + supported[i++] = prop_atoms.openbox_rc; + supported[i++] = prop_atoms.openbox_control; g_assert(i == num_support); PROP_SETA32(RootWindow(ob_display, ob_screen),