@@ -2241,7 +2241,7 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, xcb_get_window_at
22412241 ewmh_client_check_hints (c );
22422242
22432243 /* Push client in stack */
2244- stack_client_push (c );
2244+ stack_client_push (L , c , "manage" );
22452245
22462246 /* Request our response */
22472247 xcb_get_property_reply_t * reply =
@@ -2717,7 +2717,7 @@ client_set_fullscreen(lua_State *L, int cidx, bool s)
27172717 luaA_object_emit_signal (L , abs_cidx , "property::fullscreen" , 0 );
27182718 /* Force a client resize, so that titlebars get shown/hidden */
27192719 client_resize_do (c , c -> geometry );
2720- stack_windows ();
2720+ stack_windows (L , "fullscreen" , c , NULL );
27212721 }
27222722}
27232723
@@ -2768,7 +2768,7 @@ client_set_maximized_common(lua_State *L, int cidx, bool s, const char* type, co
27682768 if (max_before != c -> maximized )
27692769 luaA_object_emit_signal (L , abs_cidx , "property::maximized" , 0 );
27702770
2771- stack_windows ();
2771+ stack_windows (L , "maximized" , c , NULL );
27722772 }
27732773}
27742774
@@ -2816,7 +2816,7 @@ client_set_above(lua_State *L, int cidx, bool s)
28162816 client_set_fullscreen (L , cidx , false);
28172817 }
28182818 c -> above = s ;
2819- stack_windows ();
2819+ stack_windows (L , "above" , c , NULL );
28202820 luaA_object_emit_signal (L , cidx , "property::above" , 0 );
28212821 }
28222822}
@@ -2841,7 +2841,7 @@ client_set_below(lua_State *L, int cidx, bool s)
28412841 client_set_fullscreen (L , cidx , false);
28422842 }
28432843 c -> below = s ;
2844- stack_windows ();
2844+ stack_windows (L , "below" , c , NULL );
28452845 luaA_object_emit_signal (L , cidx , "property::below" , 0 );
28462846 }
28472847}
@@ -2859,7 +2859,7 @@ client_set_modal(lua_State *L, int cidx, bool s)
28592859 if (c -> modal != s )
28602860 {
28612861 c -> modal = s ;
2862- stack_windows ();
2862+ stack_windows (L , "modal" , c , NULL );
28632863 luaA_object_emit_signal (L , cidx , "property::modal" , 0 );
28642864 }
28652865}
@@ -2884,7 +2884,7 @@ client_set_ontop(lua_State *L, int cidx, bool s)
28842884 client_set_fullscreen (L , cidx , false);
28852885 }
28862886 c -> ontop = s ;
2887- stack_windows ();
2887+ stack_windows (L , "ontop" , c , NULL );
28882888 luaA_object_emit_signal (L , cidx , "property::ontop" , 0 );
28892889 }
28902890}
@@ -2942,7 +2942,7 @@ client_unmanage(client_t *c, client_unmanage_t reason)
29422942 client_array_remove (& globalconf .clients , elem );
29432943 break ;
29442944 }
2945- stack_client_remove (c );
2945+ stack_client_remove (L , c , false, "unmanage" );
29462946 for (int i = 0 ; i < globalconf .tags .len ; i ++ )
29472947 untag_client (c , globalconf .tags .tab [i ]);
29482948
@@ -3402,7 +3402,29 @@ luaA_client_raise(lua_State *L)
34023402 )
34033403 return 0 ;
34043404
3405- client_raise (c );
3405+ client_t * tc = c ;
3406+ int counter = 0 ;
3407+
3408+ /* Find number of transient layers. */
3409+ for (counter = 0 ; tc -> transient_for ; counter ++ )
3410+ tc = tc -> transient_for ;
3411+
3412+ /* Push them in reverse order. */
3413+ for (; counter > 0 ; counter -- )
3414+ {
3415+ tc = c ;
3416+ for (int i = 0 ; i < counter ; i ++ )
3417+ tc = tc -> transient_for ;
3418+ stack_client_append (L , tc , "raise" );
3419+ }
3420+
3421+ /* Push c on top of the stack. */
3422+ stack_client_append (L , c , "raise" );
3423+
3424+ /* Notify the listeners */
3425+ luaA_object_push (L , c );
3426+ luaA_object_emit_signal (L , -1 , "raised" , 0 );
3427+ lua_pop (L , 1 );
34063428
34073429 return 0 ;
34083430}
@@ -3426,11 +3448,11 @@ luaA_client_lower(lua_State *L)
34263448 if (globalconf .stack .len && globalconf .stack .tab [0 ] == c )
34273449 return 0 ;
34283450
3429- stack_client_push (c );
3451+ stack_client_push (L , c , "lower" );
34303452
34313453 /* Traverse all transient layers. */
34323454 for (client_t * tc = c -> transient_for ; tc ; tc = tc -> transient_for )
3433- stack_client_push (tc );
3455+ stack_client_push (L , tc , "lower" );
34343456
34353457 /* Notify the listeners */
34363458 luaA_object_push (L , c );
0 commit comments