@@ -138,5 +138,33 @@ $(function () {
138
138
client . mouse_grabbed = false ;
139
139
client . toolbar_position = "custom" ;
140
140
client . reconfigure_all_trays ( ) ;
141
+
142
+ if ( float_menu . children ( ".Menu" ) . hasClass ( "-vertical" ) ) {
143
+ return ;
144
+ }
145
+
146
+ // If the float menu is in the upper half of the screen, the menu_list and open_windows_list will open downwards, and vice versa.
147
+ const float_menu_top_css = float_menu . css ( "top" )
148
+ const float_menu_top = float_menu_top_css . substring ( 0 , float_menu_top_css . length - 2 ) ;
149
+
150
+ if ( Number ( float_menu_top ) > client . desktop_height / 2 ) {
151
+ $ ( "#menu_list" ) . css ( "bottom" , "30px" ) ;
152
+ $ ( "#open_windows_list" ) . css ( {
153
+ "bottom" : "30px" ,
154
+ "border-top-left-radius" : "3px" ,
155
+ "border-top-right-radius" : "3px" ,
156
+ "border-bottom-left-radius" : "0px" ,
157
+ "border-bottom-right-radius" : "0px"
158
+ } ) ;
159
+ } else {
160
+ $ ( "#menu_list" ) . css ( "bottom" , "unset" ) ;
161
+ $ ( "#open_windows_list" ) . css ( {
162
+ "bottom" : "unset" ,
163
+ "border-top-left-radius" : "0px" ,
164
+ "border-top-right-radius" : "0px" ,
165
+ "border-bottom-left-radius" : "3px" ,
166
+ "border-bottom-right-radius" : "3px"
167
+ } ) ;
168
+ }
141
169
} ) ;
142
170
} ) ;
0 commit comments