summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-09-06 20:45:36 +0200
committerDaniel Friesel <derf@finalrewind.org>2010-09-06 20:45:36 +0200
commit001ba877deaed7cc47777206e8ab439ceae01a2d (patch)
treee809dff6ae7957b0f2102b083971f7a3c962f13b /src
parentceef46e7981b5044713b689cb8c76d1d8eee518c (diff)
Work around Xinerama Fuckups: Read screen number from XINERAMA_SCREEN env var
Diffstat (limited to 'src')
-rw-r--r--src/imlib.c5
-rw-r--r--src/keyevents.c3
-rw-r--r--src/menu.c3
-rw-r--r--src/winwidget.c4
4 files changed, 14 insertions, 1 deletions
diff --git a/src/imlib.c b/src/imlib.c
index 206282a..48bc4ea 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -55,7 +55,10 @@ void init_xinerama(void)
{
if (opt.xinerama && XineramaIsActive(disp)) {
int major, minor;
- xinerama_screen = 0;
+ if (getenv("XINERAMA_SCREEN"))
+ xinerama_screen = atoi(getenv("XINERAMA_SCREEN"));
+ else
+ xinerama_screen = 0;
XineramaQueryVersion(disp, &major, &minor);
xinerama_screens = XineramaQueryScreens(disp, &num_xinerama_screens);
}
diff --git a/src/keyevents.c b/src/keyevents.c
index c2c50ae..81e43e7 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -419,6 +419,9 @@ void feh_event_handle_keypress(XEvent * ev)
break;
}
}
+ if (getenv("XINERAMA_SCREEN"))
+ curr_screen = xinerama_screen =
+ atoi(getenv("XINERAMA_SCREEN"));
}
#endif /* HAVE_LIBXINERAMA */
winwid->full_screen = !winwid->full_screen;
diff --git a/src/menu.c b/src/menu.c
index 9fb89df..c50f015 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1258,6 +1258,9 @@ void feh_menu_cb_opt_fullscreen(feh_menu * m, feh_menu_item * i)
}
}
+ if (getenv("XINERAMA_SCREEN"))
+ curr_screen = xinerama_screen =
+ atoi(getenv("XINERAMA_SCREEN"));
}
#endif /* HAVE_LIBXINERAMA */
diff --git a/src/winwidget.c b/src/winwidget.c
index e0862f8..771024b 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -158,6 +158,8 @@ void winwidget_create_window(winwidget ret, int w, int h)
if (opt.xinerama && xinerama_screens) {
w = xinerama_screens[xinerama_screen].width;
h = xinerama_screens[xinerama_screen].height;
+ x = xinerama_screens[xinerama_screen].x_org;
+ y = xinerama_screens[xinerama_screen].y_org;
}
#endif /* HAVE_LIBXINERAMA */
} else if (opt.geom_flags) {
@@ -779,6 +781,8 @@ void winwidget_resize(winwidget winwid, int w, int h)
}
}
+ if (getenv("XINERAMA_SCREEN"))
+ xinerama_screen = atoi(getenv("XINERAMA_SCREEN"));
}
#endif /* HAVE_LIBXINERAMA */