Add emulatexinerama option in desktops section that splits the screen in two side...
authorMikael Magnusson <mikachu@comhem.se>
Mon, 23 Jul 2007 23:35:12 +0000 (01:35 +0200)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 28 Feb 2008 03:35:11 +0000 (04:35 +0100)
openbox/config.c
openbox/config.h
openbox/screen.c

index fa1a2aaf377cbd0dcc573b84d38d21673f2f15cf..bafa35ce86d98653fcbba30133503226b87c8693 100644 (file)
@@ -58,6 +58,7 @@ guint   config_desktops_num;
 GSList *config_desktops_names;
 guint   config_screen_firstdesk;
 guint   config_desktop_popup_time;
+gint    config_emulate_xinerama;
 
 gboolean         config_resize_redraw;
 gint             config_resize_popup_show;
@@ -632,6 +633,8 @@ static void parse_desktops(xmlNodePtr node, gpointer d)
         if (d > 0)
             config_screen_firstdesk = (unsigned) d;
     }
+    if ((n = obt_parse_find_node(node, "emulatexinerama")))
+        config_emulate_xinerama = obt_parse_node_bool(n);
     if ((n = obt_parse_find_node(node, "names"))) {
         GSList *it;
         xmlNodePtr nname;
@@ -933,6 +936,7 @@ void config_startup(ObtParseInst *i)
 
     config_desktops_num = 4;
     config_screen_firstdesk = 1;
+    config_emulate_xinerama = FALSE;
     config_desktops_names = NULL;
     config_desktop_popup_time = 875;
 
index 8a01ee1ff4345121066695d2c59ae17cf5536aae..32c61309a82a25b4029e92d636dfd46179dc420c 100644 (file)
@@ -148,6 +148,8 @@ extern RrFont *config_font_osd;
 extern guint config_desktops_num;
 /*! Desktop to start on, put 5 to start in the center of a 3x3 grid */
 extern guint config_screen_firstdesk;
+/*! Emulate xinerama by dividing screen in two halves, left and right. */
+extern gboolean config_emulate_xinerama;
 /*! Names for the desktops */
 extern GSList *config_desktops_names;
 /*! Amount of time to show the desktop switch dialog */
index 221e338d0dded4a154de31c83970d2d16c63671f..109d0f1d5594c6c7995501b0fb7313e2c2568fe1 100644 (file)
@@ -1306,6 +1306,20 @@ static void get_xinerama_screens(Rect **xin_areas, guint *nxin)
         *xin_areas = g_new(Rect, *nxin + 1);
         RECT_SET((*xin_areas)[0], 0, 0, w/2, h);
         RECT_SET((*xin_areas)[1], w/2, 0, w-(w/2), h);
+    } else if (config_emulate_xinerama) {
+    *nxin = 2;
+    *xin_areas = g_new(Rect, *nxin + 1);
+    RECT_SET((*xin_areas)[0], 0, 0,
+                 WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen)) / 2,
+                 HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen)));
+    RECT_SET((*xin_areas)[1],
+                 WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen)) / 2,
+                 0,
+                 WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen)) / 2,
+                 HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen)));
+    RECT_SET((*xin_areas)[*nxin], 0, 0,
+                 WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen)),
+                 HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen)));
     }
 #ifdef XINERAMA
     else if (obt_display_extension_xinerama) {