respect the active/mouse options for monitor placement, and use ObMonitorPlace for per-app too

This commit is contained in:
Dana Jansens 2011-10-15 20:07:57 -04:00
parent 4aade63604
commit 8a975cb100
3 changed files with 13 additions and 16 deletions

View file

@ -111,7 +111,7 @@ ObAppSettings* config_create_app_settings(void)
settings->type = -1; settings->type = -1;
settings->decor = -1; settings->decor = -1;
settings->shade = -1; settings->shade = -1;
settings->monitor_type = 0; settings->monitor_type = OB_PLACE_MONITOR_ANY;
settings->monitor = -1; settings->monitor = -1;
settings->focus = -1; settings->focus = -1;
settings->desktop = 0; settings->desktop = 0;
@ -136,7 +136,7 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src,
copy_if(type, (ObClientType)-1); copy_if(type, (ObClientType)-1);
copy_if(decor, -1); copy_if(decor, -1);
copy_if(shade, -1); copy_if(shade, -1);
copy_if(monitor_type, 0); copy_if(monitor_type, OB_PLACE_MONITOR_ANY);
copy_if(monitor, -1); copy_if(monitor, -1);
copy_if(focus, -1); copy_if(focus, -1);
copy_if(desktop, 0); copy_if(desktop, 0);
@ -297,13 +297,13 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d)
gchar *s = obt_xml_node_string(c); gchar *s = obt_xml_node_string(c);
if (!g_ascii_strcasecmp(s, "mouse")) if (!g_ascii_strcasecmp(s, "mouse"))
settings->monitor_type = settings->monitor_type =
OB_APP_SETTINGS_MONITOR_MOUSE; OB_PLACE_MONITOR_MOUSE;
else if (!g_ascii_strcasecmp(s, "active")) else if (!g_ascii_strcasecmp(s, "active"))
settings->monitor_type = settings->monitor_type =
OB_APP_SETTINGS_MONITOR_ACTIVE; OB_PLACE_MONITOR_ACTIVE;
else if (!g_ascii_strcasecmp(s, "primary")) else if (!g_ascii_strcasecmp(s, "primary"))
settings->monitor_type = settings->monitor_type =
OB_APP_SETTINGS_MONITOR_PRIMARY; OB_PLACE_MONITOR_PRIMARY;
else else
settings->monitor = obt_xml_node_int(c); settings->monitor = obt_xml_node_int(c);
g_free(s); g_free(s);

View file

@ -33,13 +33,6 @@
typedef struct _ObAppSettings ObAppSettings; typedef struct _ObAppSettings ObAppSettings;
typedef enum {
OB_APP_SETTINGS_MONITOR_FIXED,
OB_APP_SETTINGS_MONITOR_PRIMARY,
OB_APP_SETTINGS_MONITOR_ACTIVE,
OB_APP_SETTINGS_MONITOR_MOUSE
} ObAppSettingsMonitor;
struct _ObAppSettings struct _ObAppSettings
{ {
GPatternSpec *class; GPatternSpec *class;
@ -56,7 +49,7 @@ struct _ObAppSettings
gint shade; gint shade;
gint decor; gint decor;
gint focus; gint focus;
ObAppSettingsMonitor monitor_type; ObPlaceMonitor monitor_type;
gint monitor; gint monitor;
gint iconic; gint iconic;
gint skip_pager; gint skip_pager;

View file

@ -193,21 +193,25 @@ static Rect *pick_head(ObClient *c, gboolean foreground,
if (config_place_monitor == OB_PLACE_MONITOR_PRIMARY) if (config_place_monitor == OB_PLACE_MONITOR_PRIMARY)
choice[i].flags |= HEAD_PLACED; choice[i].flags |= HEAD_PLACED;
if (settings && if (settings &&
settings->monitor_type == OB_APP_SETTINGS_MONITOR_PRIMARY) settings->monitor_type == OB_PLACE_MONITOR_PRIMARY)
choice[i].flags |= HEAD_PERAPP; choice[i].flags |= HEAD_PERAPP;
} }
i = screen_monitor_active(); i = screen_monitor_active();
if (i < screen_num_monitors) { if (i < screen_num_monitors) {
if (config_place_monitor == OB_PLACE_MONITOR_ACTIVE)
choice[i].flags |= HEAD_PLACED;
if (settings && if (settings &&
settings->monitor_type == OB_APP_SETTINGS_MONITOR_ACTIVE) settings->monitor_type == OB_PLACE_MONITOR_ACTIVE)
choice[i].flags |= HEAD_PERAPP; choice[i].flags |= HEAD_PERAPP;
} }
i = screen_monitor_pointer(); i = screen_monitor_pointer();
if (i < screen_num_monitors) { if (i < screen_num_monitors) {
if (config_place_monitor == OB_PLACE_MONITOR_MOUSE)
choice[i].flags |= HEAD_PLACED;
if (settings && if (settings &&
settings->monitor_type == OB_APP_SETTINGS_MONITOR_MOUSE) settings->monitor_type == OB_PLACE_MONITOR_MOUSE)
choice[i].flags |= HEAD_PERAPP; choice[i].flags |= HEAD_PERAPP;
} }