From 7d2a83f7d099b0403a5d008227b601b9e592d1cf Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 3 Mar 2017 13:04:48 +0100 Subject: [PATCH] screen.c: Always emit "primary_changed" when needed Without RandR telling us what the primary screen is, we just pick the first one. However, the code here did not emit the right signal. Signed-off-by: Uli Schlachter --- objects/screen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/objects/screen.c b/objects/screen.c index 76a28fc4..f81073f8 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -1010,7 +1010,14 @@ screen_t * screen_get_primary(void) { if (!globalconf.primary_screen && globalconf.screens.len > 0) + { globalconf.primary_screen = globalconf.screens.tab[0]; + + lua_State *L = globalconf_get_lua_State(); + luaA_object_push(L, globalconf.primary_screen); + luaA_object_emit_signal(L, -1, "primary_changed", 0); + lua_pop(L, 1); + } return globalconf.primary_screen; }