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>
Sat, 2 Feb 2008 19:37:53 +0000 (20:37 +0100)
openbox/config.c
openbox/config.h
openbox/screen.c

index eaaab5368ee2d65fba0b1617425bae380b1ebc92..7528b4d3cd829659c53f435303b6ca295c14b848 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;
@@ -603,6 +604,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;
@@ -897,6 +900,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 1a60ee0f75b8e604d5c23f3027ee337752218cb4..825fbfdb736547d2f6f4453e2a2df1d5b46f3118 100644 (file)
@@ -145,6 +145,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 fcd0de8c42ff2dccdb530db000cd40f687c623dd..c6c03ddc2b2ca9f27b6c8967910213dea9e988d1 100644 (file)
@@ -1297,6 +1297,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) {