@@ -37,18 +37,12 @@ static void handle_destroy(
3737 struct wl_listener * listener_ptr ,
3838 void * data_ptr );
3939
40- #if WLR_VERSION_NUM >= (18 << 8 )
4140static void handle_new_toplevel (
4241 struct wl_listener * listener_ptr ,
4342 void * data_ptr );
4443static void handle_new_popup (
4544 struct wl_listener * listener_ptr ,
4645 void * data_ptr );
47- #else // WLR_VERSION_NUM >= (18 << )8
48- static void handle_new_surface (
49- struct wl_listener * listener_ptr ,
50- void * data_ptr );
51- #endif // WLR_VERSION_NUM >= (18 << 8)
5246
5347/* == Exported methods ===================================================== */
5448
@@ -67,7 +61,6 @@ wlmaker_xdg_shell_t *wlmaker_xdg_shell_create(wlmaker_server_t *server_ptr)
6761 return NULL ;
6862 }
6963
70- #if WLR_VERSION_NUM >= (18 << 8 )
7164 wlmtk_util_connect_listener_signal (
7265 & xdg_shell_ptr -> wlr_xdg_shell_ptr -> events .new_toplevel ,
7366 & xdg_shell_ptr -> new_toplevel_listener ,
@@ -76,12 +69,6 @@ wlmaker_xdg_shell_t *wlmaker_xdg_shell_create(wlmaker_server_t *server_ptr)
7669 & xdg_shell_ptr -> wlr_xdg_shell_ptr -> events .new_popup ,
7770 & xdg_shell_ptr -> new_popup_listener ,
7871 handle_new_popup );
79- #else // WLR_VERSION_NUM >= (18 << 8)
80- wlmtk_util_connect_listener_signal (
81- & xdg_shell_ptr -> wlr_xdg_shell_ptr -> events .new_surface ,
82- & xdg_shell_ptr -> new_surface_listener ,
83- handle_new_surface );
84- #endif // WLR_VERSION_NUM >= (18 << 8)
8572 wlmtk_util_connect_listener_signal (
8673 & xdg_shell_ptr -> wlr_xdg_shell_ptr -> events .destroy ,
8774 & xdg_shell_ptr -> destroy_listener ,
@@ -94,12 +81,8 @@ wlmaker_xdg_shell_t *wlmaker_xdg_shell_create(wlmaker_server_t *server_ptr)
9481void wlmaker_xdg_shell_destroy (wlmaker_xdg_shell_t * xdg_shell_ptr )
9582{
9683 wl_list_remove (& xdg_shell_ptr -> destroy_listener .link );
97- #if WLR_VERSION_NUM >= (18 << 8 )
9884 wl_list_remove (& xdg_shell_ptr -> new_popup_listener .link );
9985 wl_list_remove (& xdg_shell_ptr -> new_toplevel_listener .link );
100- #else // WLR_VERSION_NUM >= (18 << 8)
101- wl_list_remove (& xdg_shell_ptr -> new_surface_listener .link );
102- #endif // WLR_VERSION_NUM >= (18 << 8)
10386 // Note: xdg_shell_ptr->wlr_xdg_shell_ptr is destroyed when the display
10487 // is destroyed.
10588 free (xdg_shell_ptr );
@@ -123,7 +106,6 @@ void handle_destroy(struct wl_listener *listener_ptr,
123106 wlmaker_xdg_shell_destroy (xdg_shell_ptr );
124107}
125108
126- #if WLR_VERSION_NUM >= (18 << 8 )
127109/* ------------------------------------------------------------------------- */
128110/**
129111 * Event handler for the `new_toplevel` signal raised by `wlr_xdg_shell`.
@@ -167,43 +149,4 @@ void handle_new_popup(struct wl_listener *listener_ptr,
167149 }
168150}
169151
170- #else // WLR_VERSION_NUM >= (18 << 8)
171-
172- /* ------------------------------------------------------------------------- */
173- /**
174- * Event handler for the `new_surface` signal raised by `wlr_xdg_shell`.
175- *
176- * @param listener_ptr
177- * @param data_ptr
178- */
179- void handle_new_surface (struct wl_listener * listener_ptr ,
180- void * data_ptr )
181- {
182- struct wlr_xdg_surface * wlr_xdg_surface_ptr ;
183- wlmaker_xdg_shell_t * xdg_shell_ptr = BS_CONTAINER_OF (
184- listener_ptr , wlmaker_xdg_shell_t , new_surface_listener );
185- wlr_xdg_surface_ptr = data_ptr ;
186-
187- switch (wlr_xdg_surface_ptr -> role ) {
188- case WLR_XDG_SURFACE_ROLE_POPUP :
189- // We're dealing with popups separately -- via the `new_popup` signal
190- // from the `wlr_xdg_surface` for popups as children of XDG shell
191- // surfaces, respectively the `new_popup` signal of the
192- // `wlr_scene_layer_surface` for popups of the WLR layer surface.
193- break ;
194-
195- case WLR_XDG_SURFACE_ROLE_TOPLEVEL :;
196- wlmtk_window_t * window_ptr = wlmtk_window_create_from_xdg_toplevel (
197- wlr_xdg_surface_ptr -> toplevel , xdg_shell_ptr -> server_ptr );
198- bs_log (BS_INFO , "XDG shell: Toolkit window %p for surface %p" ,
199- window_ptr , wlr_xdg_surface_ptr );
200- break ;
201-
202- default :
203- bs_log (BS_ERROR , "Unhandled role: %d" , wlr_xdg_surface_ptr -> role );
204- }
205- }
206-
207- #endif // WLR_VERSION_NUM >= (18 << 8)
208-
209152/* == End of xdg_shell.c =================================================== */
0 commit comments