summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-03-08 13:40:41 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-03-09 12:21:08 -0600
commite1ffb46a0e65137fc78a6757f78a9a4a17f8d03e (patch)
tree4c2b8e15f902b2d3c1210e749bb0751188900d59
parenta1b90cf4d72961c62cfbb42d6f9b68cdb5490241 (diff)
ecore_wl2: Remove wl_shell client support
We're never going to encounter a compositor without at least xdg v5 support, so remove wl_shell support.
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c12
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c11
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h2
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c110
4 files changed, 3 insertions, 132 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index 2905bc09eb..c45306feb0 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -286,7 +286,6 @@ _recovery_timer_add(Ecore_Wl2_Display *ewd)
286 if (ewd->wl.www) www_destroy(ewd->wl.www); 286 if (ewd->wl.www) www_destroy(ewd->wl.www);
287 if (ewd->wl.zxdg_shell) zxdg_shell_v6_destroy(ewd->wl.zxdg_shell); 287 if (ewd->wl.zxdg_shell) zxdg_shell_v6_destroy(ewd->wl.zxdg_shell);
288 if (ewd->wl.xdg_shell) xdg_shell_destroy(ewd->wl.xdg_shell); 288 if (ewd->wl.xdg_shell) xdg_shell_destroy(ewd->wl.xdg_shell);
289 if (ewd->wl.wl_shell) wl_shell_destroy(ewd->wl.wl_shell);
290 if (ewd->wl.shm) wl_shm_destroy(ewd->wl.shm); 289 if (ewd->wl.shm) wl_shm_destroy(ewd->wl.shm);
291 if (ewd->wl.data_device_manager) 290 if (ewd->wl.data_device_manager)
292 wl_data_device_manager_destroy(ewd->wl.data_device_manager); 291 wl_data_device_manager_destroy(ewd->wl.data_device_manager);
@@ -434,7 +433,6 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
434 { 433 {
435 "zxdg_shell_v6", 434 "zxdg_shell_v6",
436 "xdg_shell", 435 "xdg_shell",
437 "wl_shell",
438 NULL 436 NULL
439 }; 437 };
440 438
@@ -449,14 +447,7 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
449 447
450 if (!global) return; 448 if (!global) return;
451 449
452 if (!strcmp(global->interface, "wl_shell")) 450 if ((!strcmp(global->interface, "xdg_shell")) &&
453 {
454 ewd->wl.wl_shell =
455 wl_registry_bind(ewd->wl.registry, global->id,
456 &wl_shell_interface, 1);
457 ewd->shell_done = EINA_TRUE;
458 }
459 else if ((!strcmp(global->interface, "xdg_shell")) &&
460 (!getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL"))) 451 (!getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL")))
461 { 452 {
462 Ecore_Wl2_Window *window; 453 Ecore_Wl2_Window *window;
@@ -587,7 +578,6 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
587 if (ewd->wl.www) www_destroy(ewd->wl.www); 578 if (ewd->wl.www) www_destroy(ewd->wl.www);
588 if (ewd->wl.zxdg_shell) zxdg_shell_v6_destroy(ewd->wl.zxdg_shell); 579 if (ewd->wl.zxdg_shell) zxdg_shell_v6_destroy(ewd->wl.zxdg_shell);
589 if (ewd->wl.xdg_shell) xdg_shell_destroy(ewd->wl.xdg_shell); 580 if (ewd->wl.xdg_shell) xdg_shell_destroy(ewd->wl.xdg_shell);
590 if (ewd->wl.wl_shell) wl_shell_destroy(ewd->wl.wl_shell);
591 if (ewd->wl.shm) wl_shm_destroy(ewd->wl.shm); 581 if (ewd->wl.shm) wl_shm_destroy(ewd->wl.shm);
592 if (ewd->wl.data_device_manager) 582 if (ewd->wl.data_device_manager)
593 wl_data_device_manager_destroy(ewd->wl.data_device_manager); 583 wl_data_device_manager_destroy(ewd->wl.data_device_manager);
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 4d810a65b8..636ddf93ba 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -854,16 +854,12 @@ _keyboard_cb_enter(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigne
854 854
855 input->focus.keyboard = window; 855 input->focus.keyboard = window;
856 window->input = input; 856 window->input = input;
857
858 if (window->wl_shell_surface)
859 _ecore_wl2_input_focus_in_send(window);
860} 857}
861 858
862static void 859static void
863_keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface) 860_keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface EINA_UNUSED)
864{ 861{
865 Ecore_Wl2_Input *input; 862 Ecore_Wl2_Input *input;
866 Ecore_Wl2_Window *window;
867 863
868 input = data; 864 input = data;
869 if (!input) return; 865 if (!input) return;
@@ -876,11 +872,6 @@ _keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigne
876 if (input->repeat.timer) ecore_timer_del(input->repeat.timer); 872 if (input->repeat.timer) ecore_timer_del(input->repeat.timer);
877 input->repeat.timer = NULL; 873 input->repeat.timer = NULL;
878 input->focus.keyboard = NULL; 874 input->focus.keyboard = NULL;
879
880 /* find the window which this surface belongs to */
881 window = _ecore_wl2_display_window_surface_find(input->display, surface);
882 if ((window) && (window->wl_shell_surface))
883 _ecore_wl2_input_focus_out_send(window);
884} 875}
885 876
886static Eina_Bool 877static Eina_Bool
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index 05d42543ee..90fa3a5d02 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -88,7 +88,6 @@ struct _Ecore_Wl2_Display
88 int data_device_manager_version; 88 int data_device_manager_version;
89 struct wl_shm *shm; 89 struct wl_shm *shm;
90 struct zwp_linux_dmabuf_v1 *dmabuf; 90 struct zwp_linux_dmabuf_v1 *dmabuf;
91 struct wl_shell *wl_shell;
92 struct xdg_shell *xdg_shell; 91 struct xdg_shell *xdg_shell;
93 struct zxdg_shell_v6 *zxdg_shell; 92 struct zxdg_shell_v6 *zxdg_shell;
94 struct www *www; 93 struct www *www;
@@ -147,7 +146,6 @@ struct _Ecore_Wl2_Window
147 const char *class; 146 const char *class;
148 147
149 struct wl_surface *surface; 148 struct wl_surface *surface;
150 struct wl_shell_surface *wl_shell_surface;
151 struct xdg_surface *xdg_surface; 149 struct xdg_surface *xdg_surface;
152 struct xdg_popup *xdg_popup; 150 struct xdg_popup *xdg_popup;
153 struct www_surface *www_surface; 151 struct www_surface *www_surface;
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 35ddd256e6..fff93c4123 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -22,10 +22,6 @@ _ecore_wl_window_semi_free(Ecore_Wl2_Window *window)
22 if (window->xdg_popup) xdg_popup_destroy(window->xdg_popup); 22 if (window->xdg_popup) xdg_popup_destroy(window->xdg_popup);
23 window->xdg_popup = NULL; 23 window->xdg_popup = NULL;
24 24
25 if (window->wl_shell_surface)
26 wl_shell_surface_destroy(window->wl_shell_surface);
27 window->wl_shell_surface = NULL;
28
29 if (window->www_surface) 25 if (window->www_surface)
30 www_surface_destroy(window->www_surface); 26 www_surface_destroy(window->www_surface);
31 window->www_surface = NULL; 27 window->www_surface = NULL;
@@ -58,39 +54,6 @@ _ecore_wl2_window_configure_send(Ecore_Wl2_Window *window, int w, int h, unsigne
58} 54}
59 55
60static void 56static void
61_wl_shell_surface_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial)
62{
63 wl_shell_surface_pong(shell_surface, serial);
64}
65
66static void
67_wl_shell_surface_cb_configure(void *data, struct wl_shell_surface *shell_surface EINA_UNUSED, unsigned int edges, int w, int h)
68{
69 Ecore_Wl2_Window *win = data;
70
71 _ecore_wl2_window_configure_send(win, w, h, edges, win->fullscreen,
72 win->maximized);
73}
74
75static void
76_wl_shell_surface_cb_popup_done(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface EINA_UNUSED)
77{
78 Ecore_Wl2_Window *win;
79
80 win = data;
81 if (!win) return;
82
83 _ecore_wl2_input_ungrab(win->input);
84}
85
86static const struct wl_shell_surface_listener _wl_shell_surface_listener =
87{
88 _wl_shell_surface_cb_ping,
89 _wl_shell_surface_cb_configure,
90 _wl_shell_surface_cb_popup_done
91};
92
93static void
94_xdg_popup_cb_done(void *data, struct xdg_popup *xdg_popup EINA_UNUSED) 57_xdg_popup_cb_done(void *data, struct xdg_popup *xdg_popup EINA_UNUSED)
95{ 58{
96 Ecore_Wl2_Window *win; 59 Ecore_Wl2_Window *win;
@@ -375,15 +338,6 @@ _ecore_wl2_window_type_set(Ecore_Wl2_Window *win)
375 xdg_popup_add_listener(win->xdg_popup, 338 xdg_popup_add_listener(win->xdg_popup,
376 &_xdg_popup_listener, win); 339 &_xdg_popup_listener, win);
377 } 340 }
378 else if (win->wl_shell_surface)
379 {
380 wl_shell_surface_set_popup(win->wl_shell_surface,
381 input->wl.seat,
382 wl_display_get_serial(win->display->wl.display),
383 win->parent->surface,
384 win->geometry.x,
385 win->geometry.y, 0);
386 }
387 } 341 }
388 break; 342 break;
389 case ECORE_WL2_WINDOW_TYPE_TOPLEVEL: 343 case ECORE_WL2_WINDOW_TYPE_TOPLEVEL:
@@ -400,8 +354,6 @@ _ecore_wl2_window_type_set(Ecore_Wl2_Window *win)
400 } 354 }
401 else if (win->xdg_surface) 355 else if (win->xdg_surface)
402 xdg_surface_set_parent(win->xdg_surface, NULL); 356 xdg_surface_set_parent(win->xdg_surface, NULL);
403 else if (win->wl_shell_surface)
404 wl_shell_surface_set_toplevel(win->wl_shell_surface);
405 break; 357 break;
406 default: 358 default:
407 break; 359 break;
@@ -525,23 +477,6 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
525 window->pending.configure = EINA_FALSE; 477 window->pending.configure = EINA_FALSE;
526 _ecore_wl2_window_type_set(window); 478 _ecore_wl2_window_type_set(window);
527 } 479 }
528 else if ((window->display->wl.wl_shell) && (!window->wl_shell_surface))
529 {
530 window->wl_shell_surface =
531 wl_shell_get_shell_surface(window->display->wl.wl_shell,
532 window->surface);
533 if (!window->wl_shell_surface) goto surf_err;
534
535 if (window->title)
536 wl_shell_surface_set_title(window->wl_shell_surface, window->title);
537 if (window->class)
538 wl_shell_surface_set_class(window->wl_shell_surface, window->class);
539
540 wl_shell_surface_add_listener(window->wl_shell_surface,
541 &_wl_shell_surface_listener, window);
542 window->pending.configure = EINA_FALSE;
543 _ecore_wl2_window_type_set(window);
544 }
545 480
546 if (window->display->wl.session_recovery) 481 if (window->display->wl.session_recovery)
547 { 482 {
@@ -765,9 +700,6 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, int x EINA_UNUSED, int y EINA_UN
765 else if (window->xdg_surface) 700 else if (window->xdg_surface)
766 xdg_surface_move(window->xdg_surface, input->wl.seat, 701 xdg_surface_move(window->xdg_surface, input->wl.seat,
767 window->display->serial); 702 window->display->serial);
768 else if (window->wl_shell_surface)
769 wl_shell_surface_move(window->wl_shell_surface, input->wl.seat,
770 window->display->serial);
771} 703}
772 704
773EAPI void 705EAPI void
@@ -791,9 +723,6 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, int w EINA_UNUSED, int h EINA_
791 else if (window->xdg_surface) 723 else if (window->xdg_surface)
792 xdg_surface_resize(window->xdg_surface, input->wl.seat, 724 xdg_surface_resize(window->xdg_surface, input->wl.seat,
793 window->display->serial, location); 725 window->display->serial, location);
794 else if (window->wl_shell_surface)
795 wl_shell_surface_resize(window->wl_shell_surface, input->wl.seat,
796 window->display->serial, location);
797} 726}
798 727
799EAPI void 728EAPI void
@@ -827,8 +756,6 @@ ecore_wl2_window_raise(Ecore_Wl2_Window *window)
827 &states, 0); 756 &states, 0);
828 wl_array_release(&states); 757 wl_array_release(&states);
829 } 758 }
830 else if (window->wl_shell_surface)
831 wl_shell_surface_set_toplevel(window->wl_shell_surface);
832} 759}
833 760
834EAPI Eina_Bool 761EAPI Eina_Bool
@@ -1033,9 +960,6 @@ ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool maximized)
1033 maximized = !!maximized; 960 maximized = !!maximized;
1034 if (prev == maximized) return; 961 if (prev == maximized) return;
1035 962
1036 if (window->wl_shell_surface)
1037 window->maximized = maximized;
1038
1039 if (maximized) 963 if (maximized)
1040 { 964 {
1041 window->saved = window->geometry; 965 window->saved = window->geometry;
@@ -1044,8 +968,6 @@ ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool maximized)
1044 zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel); 968 zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
1045 else if (window->xdg_surface) 969 else if (window->xdg_surface)
1046 xdg_surface_set_maximized(window->xdg_surface); 970 xdg_surface_set_maximized(window->xdg_surface);
1047 else if (window->wl_shell_surface)
1048 wl_shell_surface_set_maximized(window->wl_shell_surface, NULL);
1049 } 971 }
1050 else 972 else
1051 { 973 {
@@ -1053,15 +975,6 @@ ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool maximized)
1053 zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel); 975 zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
1054 else if (window->xdg_surface) 976 else if (window->xdg_surface)
1055 xdg_surface_unset_maximized(window->xdg_surface); 977 xdg_surface_unset_maximized(window->xdg_surface);
1056 else if (window->wl_shell_surface)
1057 {
1058 wl_shell_surface_set_toplevel(window->wl_shell_surface);
1059
1060 _ecore_wl2_window_configure_send(window, window->saved.w,
1061 window->saved.h, 0,
1062 window->fullscreen,
1063 window->maximized);
1064 }
1065 } 978 }
1066} 979}
1067 980
@@ -1084,9 +997,6 @@ ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
1084 fullscreen = !!fullscreen; 997 fullscreen = !!fullscreen;
1085 if (prev == fullscreen) return; 998 if (prev == fullscreen) return;
1086 999
1087 if (window->wl_shell_surface)
1088 window->fullscreen = fullscreen;
1089
1090 if (fullscreen) 1000 if (fullscreen)
1091 { 1001 {
1092 window->saved = window->geometry; 1002 window->saved = window->geometry;
@@ -1095,10 +1005,6 @@ ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
1095 zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL); 1005 zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
1096 else if (window->xdg_surface) 1006 else if (window->xdg_surface)
1097 xdg_surface_set_fullscreen(window->xdg_surface, NULL); 1007 xdg_surface_set_fullscreen(window->xdg_surface, NULL);
1098 else if (window->wl_shell_surface)
1099 wl_shell_surface_set_fullscreen(window->wl_shell_surface,
1100 WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
1101 0, NULL);
1102 } 1008 }
1103 else 1009 else
1104 { 1010 {
@@ -1106,15 +1012,6 @@ ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
1106 zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel); 1012 zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
1107 else if (window->xdg_surface) 1013 else if (window->xdg_surface)
1108 xdg_surface_unset_fullscreen(window->xdg_surface); 1014 xdg_surface_unset_fullscreen(window->xdg_surface);
1109 else if (window->wl_shell_surface)
1110 {
1111 wl_shell_surface_set_toplevel(window->wl_shell_surface);
1112
1113 _ecore_wl2_window_configure_send(window, window->saved.w,
1114 window->saved.h, 0,
1115 window->fullscreen,
1116 window->maximized);
1117 }
1118 } 1015 }
1119} 1016}
1120 1017
@@ -1146,8 +1043,6 @@ ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title)
1146 zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title); 1043 zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
1147 else if (window->xdg_surface) 1044 else if (window->xdg_surface)
1148 xdg_surface_set_title(window->xdg_surface, window->title); 1045 xdg_surface_set_title(window->xdg_surface, window->title);
1149 else if (window->wl_shell_surface)
1150 wl_shell_surface_set_title(window->wl_shell_surface, window->title);
1151} 1046}
1152 1047
1153EAPI void 1048EAPI void
@@ -1162,8 +1057,6 @@ ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas)
1162 zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class); 1057 zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
1163 else if (window->xdg_surface) 1058 else if (window->xdg_surface)
1164 xdg_surface_set_app_id(window->xdg_surface, window->class); 1059 xdg_surface_set_app_id(window->xdg_surface, window->class);
1165 else if (window->wl_shell_surface)
1166 wl_shell_surface_set_class(window->wl_shell_surface, window->class);
1167} 1060}
1168 1061
1169EAPI void 1062EAPI void
@@ -1382,6 +1275,5 @@ ecore_wl2_window_has_shell_surface(Ecore_Wl2_Window *window)
1382{ 1275{
1383 EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE); 1276 EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
1384 1277
1385 return (window->xdg_surface || 1278 return (window->xdg_surface || window->zxdg_surface);
1386 window->wl_shell_surface || window->zxdg_surface);
1387} 1279}