Advertisement
Guest User

Untitled

a guest
May 6th, 2024
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. --- client2.c 2024-05-06 14:15:27.627513115 +0900
  2. +++ plasma_shell.c 2024-05-06 14:21:03.819730307 +0900
  3. @@ -9,6 +9,10 @@
  4. #include <unistd.h>
  5. #include <wayland-client.h>
  6. #include "xdg-shell-client-protocol.h"
  7. +#include "plasma-shell-protocol.h"
  8. +
  9. +#define X 0
  10. +#define Y 0
  11.  
  12. /* Shared memory support code */
  13. static void
  14. @@ -65,8 +69,10 @@
  15. struct wl_shm *wl_shm;
  16. struct wl_compositor *wl_compositor;
  17. struct xdg_wm_base *xdg_wm_base;
  18. + struct org_kde_plasma_shell *plasma_shell;
  19. /* Objects */
  20. struct wl_surface *wl_surface;
  21. + struct org_kde_plasma_surface *plasma_surface;
  22. struct xdg_surface *xdg_surface;
  23. struct xdg_toplevel *xdg_toplevel;
  24. };
  25. @@ -164,6 +170,9 @@
  26. wl_registry, name, &xdg_wm_base_interface, 1);
  27. xdg_wm_base_add_listener(state->xdg_wm_base,
  28. &xdg_wm_base_listener, state);
  29. + } else if (strcmp(interface, org_kde_plasma_shell_interface.name) == 0) {
  30. + state->plasma_shell = wl_registry_bind(
  31. + wl_registry, name, &org_kde_plasma_shell_interface, 4);
  32. }
  33. }
  34.  
  35. @@ -191,6 +200,8 @@
  36. state.wl_surface = wl_compositor_create_surface(state.wl_compositor);
  37. state.xdg_surface = xdg_wm_base_get_xdg_surface(
  38. state.xdg_wm_base, state.wl_surface);
  39. + state.plasma_surface = org_kde_plasma_shell_get_surface(state.plasma_shell, state.wl_surface);
  40. + org_kde_plasma_surface_set_position(state.plasma_surface, X, Y);
  41. xdg_surface_add_listener(state.xdg_surface, &xdg_surface_listener, &state);
  42. state.xdg_toplevel = xdg_surface_get_toplevel(state.xdg_surface);
  43. xdg_toplevel_set_title(state.xdg_toplevel, "Example client");
  44. @@ -202,3 +213,4 @@
  45.  
  46. return 0;
  47. }
  48. +
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement