mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
swaybar: remove cursor code
This commit is contained in:
parent
30dbb8eba0
commit
51959eecd4
4 changed files with 0 additions and 39 deletions
|
|
@ -8,9 +8,6 @@ struct swaybar_output;
|
|||
|
||||
struct swaybar_pointer {
|
||||
struct wl_pointer *pointer;
|
||||
struct wl_cursor_theme *cursor_theme;
|
||||
struct wl_cursor_image *cursor_image;
|
||||
struct wl_surface *cursor_surface;
|
||||
struct swaybar_output *current;
|
||||
int x, y;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <wayland-client.h>
|
||||
#include <wayland-cursor.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "swaybar/bar.h"
|
||||
#include "swaybar/config.h"
|
||||
|
|
@ -358,25 +357,6 @@ bool bar_setup(struct swaybar *bar, const char *socket_path) {
|
|||
}
|
||||
wl_display_roundtrip(bar->display);
|
||||
|
||||
struct swaybar_pointer *pointer = &bar->pointer;
|
||||
|
||||
int max_scale = 1;
|
||||
wl_list_for_each(output, &bar->outputs, link) {
|
||||
if (output->scale > max_scale) {
|
||||
max_scale = output->scale;
|
||||
}
|
||||
}
|
||||
|
||||
pointer->cursor_theme =
|
||||
wl_cursor_theme_load(NULL, 24 * max_scale, bar->shm);
|
||||
assert(pointer->cursor_theme);
|
||||
struct wl_cursor *cursor;
|
||||
cursor = wl_cursor_theme_get_cursor(pointer->cursor_theme, "left_ptr");
|
||||
assert(cursor);
|
||||
pointer->cursor_image = cursor->images[0];
|
||||
pointer->cursor_surface = wl_compositor_create_surface(bar->compositor);
|
||||
assert(pointer->cursor_surface);
|
||||
|
||||
if (bar->config->workspace_buttons) {
|
||||
if (ipc_get_workspaces(bar)) {
|
||||
set_bar_dirty(bar);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include <linux/input-event-codes.h>
|
||||
#endif
|
||||
#include <wayland-client.h>
|
||||
#include <wayland-cursor.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "list.h"
|
||||
#include "log.h"
|
||||
|
|
@ -66,20 +65,6 @@ static void wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
|
|||
break;
|
||||
}
|
||||
}
|
||||
int max_scale = 1;
|
||||
struct swaybar_output *_output;
|
||||
wl_list_for_each(_output, &bar->outputs, link) {
|
||||
if (_output->scale > max_scale) {
|
||||
max_scale = _output->scale;
|
||||
}
|
||||
}
|
||||
wl_surface_set_buffer_scale(pointer->cursor_surface, max_scale);
|
||||
wl_surface_attach(pointer->cursor_surface,
|
||||
wl_cursor_image_get_buffer(pointer->cursor_image), 0, 0);
|
||||
wl_pointer_set_cursor(wl_pointer, serial, pointer->cursor_surface,
|
||||
pointer->cursor_image->hotspot_x / max_scale,
|
||||
pointer->cursor_image->hotspot_y / max_scale);
|
||||
wl_surface_commit(pointer->cursor_surface);
|
||||
}
|
||||
|
||||
static void wl_pointer_leave(void *data, struct wl_pointer *wl_pointer,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ executable(
|
|||
pangocairo,
|
||||
rt,
|
||||
wayland_client,
|
||||
wayland_cursor,
|
||||
wlroots,
|
||||
],
|
||||
link_with: [lib_sway_common, lib_sway_client],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue