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@gmail.com>
Sun, 19 Sep 2010 15:53:57 +0000 (17:53 +0200)
openbox/config.c
openbox/config.h
openbox/screen.c

index efcf4d9522c6918e5d48d159415947de898f7cd5..25e007103d4a30ea76a4f1bfcf44925cdffdf499 100644 (file)
@@ -64,6 +64,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;
@@ -718,6 +719,8 @@ static void parse_desktops(xmlNodePtr node, gpointer d)
         if (d > 0)
             config_screen_firstdesk = (unsigned) d;
     }
+    if ((n = obt_xml_find_node(node, "emulatexinerama")))
+        config_emulate_xinerama = obt_xml_node_bool(n);
     if ((n = obt_xml_find_node(node, "names"))) {
         GSList *it;
         xmlNodePtr nname;
@@ -1033,6 +1036,7 @@ void config_startup(ObtXmlInst *i)
 
     config_desktops_num = 4;
     config_screen_firstdesk = 1;
+    config_emulate_xinerama = FALSE;
     config_desktops_names = NULL;
     config_desktop_popup_time = 875;
 
index 890b002a8ec95d9ff169f1f336ea860612b90107..1bbf5adadfcd961b6ad02f1691f7774bbb76100a 100644 (file)
@@ -162,6 +162,8 @@ extern RrFont *config_font_inactiveosd;
 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 4d73eeac4de70a32eb1f57c0e6d39036ce83f725..3fa8030081fdd5e29c580ce77f4b3d7d5289036f 100644 (file)
@@ -1339,6 +1339,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 &&