[RP] [PATCH 5/7] Add a function to find a screen matching a given XWindowAttributes

2016-12-07 Thread Mathieu OTHACEHE
It allows to find the screen associated to a Window, using it's x and y position. --- src/screen.c | 18 ++ src/screen.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/screen.c b/src/screen.c index 0d45701..811a947 100644 --- a/src/screen.c +++ b/src/screen.c @@ -165,

[RP] [PATCH 4/7] Store RootWindow in global_screen structure

2016-12-07 Thread Mathieu OTHACEHE
Every screen stores a copy of xrandr RootWindow even if they all share the same RootWindow. This patch stores the RootWindow in a global location for all screens. Further work is required to remove RootWindow from per screen structure. --- src/data.h | 1 + src/screen.c | 1 + 2 files changed,

[RP] [PATCH 7/7] Select xrandr primary screen at startup if possible

2016-12-07 Thread Mathieu OTHACEHE
If xrandr support is enabled and a screen is marked primary, use it as current screen at startup. Otherwise, use the first screen in sorted screen list as current screen at startup. --- src/main.c | 7 --- src/screen.c | 27 +++ 2 files changed, 27 insertions(+), 7

[RP] [PATCH 6/7] Simplify scanwins function

2016-12-07 Thread Mathieu OTHACEHE
Use find_screen_by_attr function, remove screen argument and a useless debug message. --- src/main.c | 3 ++- src/manage.c | 25 +++-- src/manage.h | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/main.c b/src/main.c index ca5ebc8..cce4f94 100644

[RP] [PATCH 3/7] Add primary screen detection

2016-12-07 Thread Mathieu OTHACEHE
The user may specify that a screen is primary with xrandr. Save this information in ratpoison for future use. The use of XRRGetOutputPrimary forces us to bump xrandr supported revision from >=1.2 to >=1.3. --- src/data.h | 1 + src/xrandr.c | 15 ++- src/xrandr.h | 1 + 3 files ch

[RP] [PATCH 0/7] Add xrandr primary screen support

2016-12-07 Thread Mathieu OTHACEHE
This patch add support for xrandr primary screen detection. If any primary screen is detected at startup, it will be used as current screen. Mathieu OTHACEHE (7): Remove useless argument from is_rp_window_for_screen function Move function declaration to the right header Add primary screen de

[RP] [PATCH 2/7] Move function declaration to the right header

2016-12-07 Thread Mathieu OTHACEHE
find_screen is defined in screen.c so it makes more sense to declare it in screen.h --- src/ratpoison.h | 1 - src/screen.h| 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ratpoison.h b/src/ratpoison.h index c98dd40..981a882 100644 --- a/src/ratpoison.h +++ b/src/ratpois

[RP] [PATCH 1/7] Remove useless argument from is_rp_window_for_screen function

2016-12-07 Thread Mathieu OTHACEHE
The screen argument is useless as this function operates on all screens. To find if a window belong to a specific ratpoison screen, function is_rp_window_for_given_screen may be used. --- src/events.c | 2 +- src/manage.c | 2 +- src/screen.c | 2 +- src/screen.h | 2 +- 4 files changed, 4 inserti