Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- client2.c 2024-05-06 14:15:27.627513115 +0900
- +++ plasma_shell.c 2024-05-06 14:21:03.819730307 +0900
- @@ -9,6 +9,10 @@
- #include <unistd.h>
- #include <wayland-client.h>
- #include "xdg-shell-client-protocol.h"
- +#include "plasma-shell-protocol.h"
- +
- +#define X 0
- +#define Y 0
- /* Shared memory support code */
- static void
- @@ -65,8 +69,10 @@
- struct wl_shm *wl_shm;
- struct wl_compositor *wl_compositor;
- struct xdg_wm_base *xdg_wm_base;
- + struct org_kde_plasma_shell *plasma_shell;
- /* Objects */
- struct wl_surface *wl_surface;
- + struct org_kde_plasma_surface *plasma_surface;
- struct xdg_surface *xdg_surface;
- struct xdg_toplevel *xdg_toplevel;
- };
- @@ -164,6 +170,9 @@
- wl_registry, name, &xdg_wm_base_interface, 1);
- xdg_wm_base_add_listener(state->xdg_wm_base,
- &xdg_wm_base_listener, state);
- + } else if (strcmp(interface, org_kde_plasma_shell_interface.name) == 0) {
- + state->plasma_shell = wl_registry_bind(
- + wl_registry, name, &org_kde_plasma_shell_interface, 4);
- }
- }
- @@ -191,6 +200,8 @@
- state.wl_surface = wl_compositor_create_surface(state.wl_compositor);
- state.xdg_surface = xdg_wm_base_get_xdg_surface(
- state.xdg_wm_base, state.wl_surface);
- + state.plasma_surface = org_kde_plasma_shell_get_surface(state.plasma_shell, state.wl_surface);
- + org_kde_plasma_surface_set_position(state.plasma_surface, X, Y);
- xdg_surface_add_listener(state.xdg_surface, &xdg_surface_listener, &state);
- state.xdg_toplevel = xdg_surface_get_toplevel(state.xdg_surface);
- xdg_toplevel_set_title(state.xdg_toplevel, "Example client");
- @@ -202,3 +213,4 @@
- return 0;
- }
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement