mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
cursor: cursor_name fix
The current implementation detects resize edges over the wlr_surface, sometimes preventing the correct cursor_name to be set.
This commit is contained in:
parent
d2133ec23d
commit
2738ff2673
1 changed files with 11 additions and 3 deletions
14
src/cursor.c
14
src/cursor.c
|
|
@ -2,8 +2,14 @@
|
|||
#include "labwc.h"
|
||||
#include "menu/menu.h"
|
||||
|
||||
#define RESIZE_BORDER_WIDTH 4
|
||||
#define RESIZE_BORDER_WIDTH 2
|
||||
|
||||
/*
|
||||
* TODO: refactor code to get rid of get_resize_edges()
|
||||
* Use a wl_list of SSD instead and build RESIZE_BORDER_WIDTH into that.
|
||||
* Had to set RESIZE_BORDER_WIDTH to 2 for the time being to get
|
||||
* cursor_name to behave properly when entering surface
|
||||
*/
|
||||
static uint32_t
|
||||
get_resize_edges(struct view *view, double x, double y)
|
||||
{
|
||||
|
|
@ -172,8 +178,10 @@ process_cursor_motion(struct server *server, uint32_t time)
|
|||
}
|
||||
if (resize_edges) {
|
||||
cursor_name_set_by_server = true;
|
||||
}
|
||||
if (!resize_edges && cursor_name_set_by_server) {
|
||||
} else if (view_area != LAB_DECO_NONE) {
|
||||
cursor_name = XCURSOR_DEFAULT;
|
||||
cursor_name_set_by_server = true;
|
||||
} else if (cursor_name_set_by_server) {
|
||||
cursor_name = XCURSOR_DEFAULT;
|
||||
cursor_name_set_by_server = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue