summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-07-23 21:53:31 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-07-23 21:53:31 +0200
commit9bc266a0736ee4b02ec727c0a4b2417c62c874c9 (patch)
treeb5dad42814b44834505a2fa18533ae4695fbfea0 /src
parent4d11fb3ed92828f8840e06945801e7c9befc823f (diff)
use --xinerama-index instead of XINERAMA_INDEX to override xinerama screen selection
Diffstat (limited to 'src')
-rw-r--r--src/imlib.c4
-rw-r--r--src/keyevents.c5
-rw-r--r--src/menu.c5
-rw-r--r--src/winwidget.c4
4 files changed, 8 insertions, 10 deletions
diff --git a/src/imlib.c b/src/imlib.c
index 10ab718..58a8608 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -78,8 +78,8 @@ void init_xinerama(void)
XineramaQueryVersion(disp, &major, &minor);
xinerama_screens = XineramaQueryScreens(disp, &num_xinerama_screens);
- if (getenv("XINERAMA_SCREEN"))
- xinerama_screen = atoi(getenv("XINERAMA_SCREEN"));
+ if (opt.xinerama_index >= 0)
+ xinerama_screen = opt.xinerama_index;
else {
xinerama_screen = 0;
XQueryPointer(disp, root, &dw, &dw, &px, &py, &di, &di, &du);
diff --git a/src/keyevents.c b/src/keyevents.c
index 83fc358..4c1ed28 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -731,9 +731,8 @@ void feh_event_handle_keypress(XEvent * ev)
break;
}
}
- if (getenv("XINERAMA_SCREEN"))
- curr_screen = xinerama_screen =
- atoi(getenv("XINERAMA_SCREEN"));
+ if (opt.xinerama_index >= 0)
+ curr_screen = xinerama_screen = opt.xinerama_index;
}
#endif /* HAVE_LIBXINERAMA */
winwid->full_screen = !winwid->full_screen;
diff --git a/src/menu.c b/src/menu.c
index b8698ab..3320767 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1154,9 +1154,8 @@ 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"));
+ if (opt.xinerama_index >= 0)
+ curr_screen = xinerama_screen = opt.xinerama_index;
}
#endif /* HAVE_LIBXINERAMA */
diff --git a/src/winwidget.c b/src/winwidget.c
index 65cefca..8bf1dbb 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -826,8 +826,8 @@ void winwidget_resize(winwidget winwid, int w, int h)
}
}
- if (getenv("XINERAMA_SCREEN"))
- xinerama_screen = atoi(getenv("XINERAMA_SCREEN"));
+ if (opt.xinerama_index >= 0)
+ xinerama_screen = opt.xinerama_index;
scr_width = xinerama_screens[xinerama_screen].width;
scr_height = xinerama_screens[xinerama_screen].height;