diff --git a/screen.c b/screen.c index 7607d0ae7..a2cf44d0b 100644 --- a/screen.c +++ b/screen.c @@ -138,6 +138,20 @@ get_screen_count(Display *disp) return screen_number; } +/** This returns the real X screen number for a logical + * screen if Xinerama is active. + * \param disp Display ref + * \param screen the logical screen + * \return the X screen + */ +int +get_real_screen(Display *disp, int screen) +{ + if(XineramaIsActive(disp)) + return DefaultScreen(disp); + return screen; +} + void move_client_to_screen(Client *c, awesome_config *acf_new) { diff --git a/screen.h b/screen.h index 68cebab1d..89d53a6e7 100644 --- a/screen.h +++ b/screen.h @@ -32,6 +32,7 @@ ScreenInfo * get_screen_info(Display *, int, Statusbar *, int *); ScreenInfo * get_display_info(Display *, int, Statusbar *); int get_screen_bycoord(Display *, int, int); int get_screen_count(Display *); +int get_real_screen(Display *, int); void move_client_to_screen(Client *, awesome_config *); UICB_PROTO(uicb_focusnextscreen); UICB_PROTO(uicb_focusprevscreen);