#include "config.h"
#include "screen.h"
#include "client.h"
+#include "session.h"
#include "frame.h"
#include "event.h"
#include "focus.h"
XSetWindowAttributes attrib;
pid_t pid;
gint i, num_support;
+ Atom *prop_atoms_start, *wm_supported_pos;
gulong *supported;
/* create the netwm support window */
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;
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;
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_config;
+ supported[i++] = prop_atoms.openbox_control;
g_assert(i == num_support);
PROP_SETA32(RootWindow(ob_display, ob_screen),
net_current_desktop, cardinal, &d) &&
d < screen_num_desktops)
{
- screen_set_desktop(d);
- } else
+ screen_set_desktop(d, FALSE);
+ } else if (session_desktop >= 0)
+ screen_set_desktop(MIN((guint)session_desktop,
+ screen_num_desktops), FALSE);
+ else
screen_set_desktop(MIN(config_screen_firstdesk,
- screen_num_desktops) - 1);
+ screen_num_desktops) - 1, FALSE);
/* don't start in showing-desktop mode */
screen_showing_desktop = FALSE;
/* change our desktop if we're on one that no longer exists! */
if (screen_desktop >= screen_num_desktops)
- screen_set_desktop(num - 1);
+ screen_set_desktop(num - 1, TRUE);
}
-void screen_set_desktop(guint num)
+void screen_set_desktop(guint num, gboolean dofocus)
{
ObClient *c;
GList *it;
/* have to try focus here because when you leave an empty desktop
there is no focus out to watch for */
- if ((c = focus_fallback_target(TRUE, focus_client))) {
+ if (dofocus && (c = focus_fallback_target(TRUE, focus_client))) {
/* reduce flicker by hiliting now rather than waiting for the server
FocusIn event */
frame_adjust_focus(c->frame, TRUE);