summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-09-02 09:14:36 -0400
committerChris Michael <cp.michael@samsung.com>2014-09-04 16:08:51 -0400
commit665a7f6e1f13531cd935a255fe86967f1975d445 (patch)
tree17d958c786f85f833502a950dbbcc2294ea9fe9e
parentc1b659936f887ede963b47f628c2a10aac2664b8 (diff)
ecore-wayland: Cleanup shell surface creationdevs/devilhorns/xdg_shell
Summary: We had some duplication happening here when the IVI shell code got added. This cleans up the surface creation code (parts of it were being duplicated) @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c46
1 files changed, 10 insertions, 36 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index bc4b204a75..ee8b274ca3 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -304,17 +304,16 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
304 if (!win->ivi_surface) 304 if (!win->ivi_surface)
305 { 305 {
306#endif 306#endif
307 if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell)) 307 if ((!win->xdg_surface) && (_ecore_wl_disp->wl.xdg_shell))
308 if ((!win->xdg_surface) && (_ecore_wl_disp->wl.xdg_shell)) 308 {
309 { 309 win->xdg_surface =
310 win->xdg_surface = 310 xdg_shell_get_xdg_surface(_ecore_wl_disp->wl.xdg_shell,
311 xdg_shell_get_xdg_surface(_ecore_wl_disp->wl.xdg_shell, 311 win->surface);
312 win->surface); 312 if (!win->xdg_surface) return;
313 if (!win->xdg_surface) return; 313 xdg_surface_set_user_data(win->xdg_surface, win);
314 xdg_surface_set_user_data(win->xdg_surface, win); 314 xdg_surface_add_listener(win->xdg_surface,
315 xdg_surface_add_listener(win->xdg_surface, 315 &_ecore_xdg_surface_listener, win);
316 &_ecore_xdg_surface_listener, win); 316 }
317 }
318 else if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell)) 317 else if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell))
319 { 318 {
320 win->shell_surface = 319 win->shell_surface =
@@ -335,31 +334,6 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
335#ifdef USE_IVI_SHELL 334#ifdef USE_IVI_SHELL
336 } 335 }
337#endif 336#endif
338 win->xdg_surface =
339 xdg_shell_get_xdg_surface(_ecore_wl_disp->wl.xdg_shell,
340 win->surface);
341 if (!win->xdg_surface) return;
342 xdg_surface_set_user_data(win->xdg_surface, win);
343 xdg_surface_add_listener(win->xdg_surface,
344 &_ecore_xdg_surface_listener, win);
345 }
346 else if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell))
347 {
348 win->shell_surface =
349 wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell,
350 win->surface);
351 if (!win->shell_surface) return;
352
353 wl_shell_surface_add_listener(win->shell_surface,
354 &_ecore_wl_shell_surface_listener,
355 win);
356
357 if (win->title)
358 wl_shell_surface_set_title(win->shell_surface, win->title);
359
360 if (win->class_name)
361 wl_shell_surface_set_class(win->shell_surface, win->class_name);
362 }
363 } 337 }
364 338
365 /* trap for valid shell surface */ 339 /* trap for valid shell surface */