diff options
author | SooChan Lim <sc1.lim@samsung.com> | 2022-06-23 11:06:31 +0900 |
---|---|---|
committer | SooChan Lim <sc1.lim@samsung.com> | 2022-06-23 11:11:08 +0900 |
commit | e00aff383c07901a8d3ecba529e8320a706dc7f7 (patch) | |
tree | 32ecae7d94adabf66affae2c5506f740f3ad9cbf | |
parent | d7ed2318aa946ea9f94995ff80ec8575c95edd05 (diff) | |
download | Vulkan-Tools-e00aff383c07901a8d3ecba529e8320a706dc7f7.tar.gz Vulkan-Tools-e00aff383c07901a8d3ecba529e8320a706dc7f7.tar.bz2 Vulkan-Tools-e00aff383c07901a8d3ecba529e8320a706dc7f7.zip |
Add TIZEN_SUPPPORT_XDG_DECORATION definitiontizen_7.0_m2_releasesubmit/tizen/20220623.022445accepted/tizen/unified/20220623.052339accepted/tizen/7.0/unified/hotfix/20221116.110558accepted/tizen/7.0/unified/20221110.055908tizen_7.0_hotfixtizen_7.0accepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unified
not to build xdg_decoration codes.
Change-Id: I32cd5485d7de480ed61c61d9cc4bb1f50eec52ee
-rw-r--r-- | cube/cube.c | 17 | ||||
-rw-r--r-- | cube/cube.cpp | 35 |
2 files changed, 38 insertions, 14 deletions
diff --git a/cube/cube.c b/cube/cube.c index 7440358b..75742d2c 100644 --- a/cube/cube.c +++ b/cube/cube.c @@ -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) {} diff --git a/cube/cube.cpp b/cube/cube.cpp index 32a5ec2f..e80b66cb 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -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); } |