Add TIZEN_SUPPPORT_XDG_DECORATION definition 59/276659/1 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_7.0 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.055908 accepted/tizen/7.0/unified/hotfix/20221116.110558 accepted/tizen/unified/20220623.052339 submit/tizen/20220623.022445 tizen_7.0_m2_release
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 23 Jun 2022 02:06:31 +0000 (11:06 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 23 Jun 2022 02:11:08 +0000 (11:11 +0900)
not to build xdg_decoration codes.

Change-Id: I32cd5485d7de480ed61c61d9cc4bb1f50eec52ee

cube/cube.c
cube/cube.cpp

index 7440358..75742d2 100644 (file)
@@ -40,7 +40,9 @@
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
 #include "xdg-shell-client-header.h"
 #endif
-//#include "xdg-decoration-client-header.h"
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
+#include "xdg-decoration-client-header.h"
+#endif
 #endif
 
 #ifdef _WIN32
@@ -344,8 +346,10 @@ struct demo {
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
     struct xdg_wm_base *xdg_wm_base;
 #endif
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
     struct zxdg_decoration_manager_v1 *xdg_decoration_mgr;
     struct zxdg_toplevel_decoration_v1 *toplevel_decoration;
+#endif
     struct wl_shell_surface *xdg_surface;
     int xdg_surface_has_been_configured;
     struct xdg_toplevel *xdg_toplevel;
@@ -2414,6 +2418,8 @@ static void demo_cleanup(struct demo *demo) {
     wl_surface_destroy(demo->window);
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
     xdg_wm_base_destroy(demo->xdg_wm_base);
+#endif
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
     if (demo->xdg_decoration_mgr) {
         zxdg_toplevel_decoration_v1_destroy(demo->toplevel_decoration);
         zxdg_decoration_manager_v1_destroy(demo->xdg_decoration_mgr);
@@ -2855,6 +2861,8 @@ static void demo_create_window(struct demo *demo) {
     xdg_surface_add_listener(demo->xdg_surface, &xdg_surface_listener, demo);
     xdg_toplevel_add_listener(demo->xdg_toplevel, &xdg_toplevel_listener, demo);
     xdg_toplevel_set_title(demo->xdg_toplevel, APP_SHORT_NAME);
+#endif
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
     if (demo->xdg_decoration_mgr) {
         // if supported, let the compositor render titlebars for us
         demo->toplevel_decoration =
@@ -3926,9 +3934,12 @@ static void registry_handle_global(void *data, struct wl_registry *registry, uin
     else if (strcmp(interface, wl_seat_interface.name) == 0) {
         demo->seat = wl_registry_bind(registry, id, &wl_seat_interface, 1);
         wl_seat_add_listener(demo->seat, &seat_listener, demo);
-    } /*else if (strcmp(interface, zxdg_decoration_manager_v1_interface.name) == 0) {
+    }
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
+    else if (strcmp(interface, zxdg_decoration_manager_v1_interface.name) == 0) {
         demo->xdg_decoration_mgr = wl_registry_bind(registry, id, &zxdg_decoration_manager_v1_interface, 1);
-    }*/
+    }
+#endif
 }
 
 static void registry_handle_global_remove(void *data UNUSED, struct wl_registry *registry UNUSED, uint32_t name UNUSED) {}
index 32a5ec2..e80b66c 100644 (file)
@@ -25,7 +25,9 @@
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
 #include "xdg-shell-client-header.h"
 #endif
-//#include "xdg-decoration-client-header.h"
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
+#include "xdg-decoration-client-header.h"
+#endif
 #endif
 
 #include <cassert>
@@ -293,8 +295,10 @@ struct Demo {
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
     xdg_wm_base *wm_base;
 #endif
-    //zxdg_decoration_manager_v1 *xdg_decoration_mgr;
-    //zxdg_toplevel_decoration_v1 *toplevel_decoration;
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
+    zxdg_decoration_manager_v1 *xdg_decoration_mgr;
+    zxdg_toplevel_decoration_v1 *toplevel_decoration;
+#endif
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
     xdg_surface *window_surface;
 #endif
@@ -518,10 +522,13 @@ static void registry_handle_global(void *data, wl_registry *registry, uint32_t i
     else if (strcmp(interface, wl_seat_interface.name) == 0) {
         demo->seat = (wl_seat *)wl_registry_bind(registry, id, &wl_seat_interface, 1);
         wl_seat_add_listener(demo->seat, &seat_listener, demo);
-    } /*else if (strcmp(interface, zxdg_decoration_manager_v1_interface.name) == 0) {
+    }
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
+    else if (strcmp(interface, zxdg_decoration_manager_v1_interface.name) == 0) {
         demo->xdg_decoration_mgr =
             (zxdg_decoration_manager_v1 *)wl_registry_bind(registry, id, &zxdg_decoration_manager_v1_interface, 1);
-    }*/
+    }
+#endif
 }
 
 static void registry_handle_global_remove(void *data, wl_registry *registry, uint32_t name) {}
@@ -553,8 +560,10 @@ Demo::Demo()
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
       wm_base{nullptr},
 #endif
-      //xdg_decoration_mgr{nullptr},
-      //toplevel_decoration{nullptr},
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
+      xdg_decoration_mgr{nullptr},
+      toplevel_decoration{nullptr},
+#endif
       window_surface{nullptr},
       xdg_surface_has_been_configured{false},
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
@@ -715,10 +724,12 @@ void Demo::cleanup() {
 #ifdef TIZEN_SUPPPORT_XDG_WM_BASE
     xdg_wm_base_destroy(wm_base);
 #endif
-    /*if (xdg_decoration_mgr) {
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
+    if (xdg_decoration_mgr) {
         zxdg_toplevel_decoration_v1_destroy(toplevel_decoration);
         zxdg_decoration_manager_v1_destroy(xdg_decoration_mgr);
-    }*/
+    }
+#endif
     wl_compositor_destroy(compositor);
     wl_registry_destroy(registry);
     wl_display_disconnect(display);
@@ -2948,11 +2959,13 @@ void Demo::create_window() {
     xdg_toplevel_add_listener(window_toplevel, &toplevel_listener, this);
     xdg_toplevel_set_title(window_toplevel, APP_SHORT_NAME);
 #endif
-    /*if (xdg_decoration_mgr) {
+#ifdef TIZEN_SUPPPORT_XDG_DECORATION
+    if (xdg_decoration_mgr) {
         // if supported, let the compositor render titlebars for us
         toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(xdg_decoration_mgr, window_toplevel);
         zxdg_toplevel_decoration_v1_set_mode(toplevel_decoration, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
-    }*/
+    }
+#endif
 
     wl_surface_commit(window);
 }