mirror of
https://github.com/labwc/labwc.git
synced 2026-02-17 22:05:30 -05:00
cursor: Restore drag icon after the move to scene-graph
Also move everything DnD related to src/dnd.c
This commit is contained in:
parent
3e1a800c14
commit
deb658b672
6 changed files with 241 additions and 55 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include <assert.h>
|
||||
#include "common/list.h"
|
||||
#include "common/scene-helpers.h"
|
||||
#include "dnd.h"
|
||||
#include "labwc.h"
|
||||
#include "layers.h"
|
||||
#include "node.h"
|
||||
|
|
@ -295,10 +296,20 @@ get_cursor_context(struct server *server)
|
|||
{
|
||||
struct cursor_context ret = {.type = LAB_SSD_NONE};
|
||||
struct wlr_cursor *cursor = server->seat.cursor;
|
||||
|
||||
/* Prevent drag icons to be on top of the hitbox detection */
|
||||
if (server->seat.drag.active) {
|
||||
dnd_icons_show(&server->seat, false);
|
||||
}
|
||||
|
||||
struct wlr_scene_node *node =
|
||||
wlr_scene_node_at(&server->scene->tree.node,
|
||||
cursor->x, cursor->y, &ret.sx, &ret.sy);
|
||||
|
||||
if (server->seat.drag.active) {
|
||||
dnd_icons_show(&server->seat, true);
|
||||
}
|
||||
|
||||
ret.node = node;
|
||||
if (!node) {
|
||||
ret.type = LAB_SSD_ROOT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue