mirror of
https://github.com/labwc/labwc.git
synced 2026-04-02 07:15:43 -04:00
input: extract function
This commit is contained in:
parent
3dd4bc7c3b
commit
ebe81ac591
3 changed files with 17 additions and 5 deletions
|
|
@ -19,5 +19,6 @@ struct drawing_tablet_tool {
|
||||||
|
|
||||||
void tablet_tool_init(struct seat *seat,
|
void tablet_tool_init(struct seat *seat,
|
||||||
struct wlr_tablet_tool *wlr_tablet_tool);
|
struct wlr_tablet_tool *wlr_tablet_tool);
|
||||||
|
bool tablet_tool_has_focused_surface(struct seat *seat);
|
||||||
|
|
||||||
#endif /* LABWC_TABLET_TOOL_H */
|
#endif /* LABWC_TABLET_TOOL_H */
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
#include "input/gestures.h"
|
#include "input/gestures.h"
|
||||||
#include "input/touch.h"
|
#include "input/touch.h"
|
||||||
#include "input/tablet-tool.h"
|
#include "input/tablet-tool.h"
|
||||||
|
#include "input/tablet-pad.h"
|
||||||
#include "labwc.h"
|
#include "labwc.h"
|
||||||
#include "layers.h"
|
#include "layers.h"
|
||||||
#include "menu/menu.h"
|
#include "menu/menu.h"
|
||||||
|
|
@ -150,11 +151,8 @@ request_cursor_notify(struct wl_listener *listener, void *data)
|
||||||
* when a tablet tool enters proximity on a tablet-capable surface.
|
* when a tablet tool enters proximity on a tablet-capable surface.
|
||||||
* See also `notify_motion()` in `input/tablet.c`.
|
* See also `notify_motion()` in `input/tablet.c`.
|
||||||
*/
|
*/
|
||||||
struct drawing_tablet_tool *tool;
|
if (tablet_tool_has_focused_surface(seat)) {
|
||||||
wl_list_for_each(tool, &seat->tablet_tools, link) {
|
return;
|
||||||
if (tool->tool_v2->focused_surface) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,19 @@
|
||||||
#include "input/tablet-tool.h"
|
#include "input/tablet-tool.h"
|
||||||
#include "labwc.h"
|
#include "labwc.h"
|
||||||
|
|
||||||
|
bool
|
||||||
|
tablet_tool_has_focused_surface(struct seat *seat)
|
||||||
|
{
|
||||||
|
struct drawing_tablet_tool *tool;
|
||||||
|
wl_list_for_each(tool, &seat->tablet_tools, link) {
|
||||||
|
if (tool->tool_v2->focused_surface) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_set_cursor(struct wl_listener *listener, void *data)
|
handle_set_cursor(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue