mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-15 08:21:41 -04:00
fix: miss remove destroy destroy listener after tablet devece destroy
This commit is contained in:
parent
b4fce75270
commit
92ed929a3c
1 changed files with 8 additions and 6 deletions
|
|
@ -55,7 +55,10 @@ void createtablet(struct wlr_input_device *device) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroytablet(struct wl_listener *listener, void *data) { tablet = NULL; }
|
void destroytablet(struct wl_listener *listener, void *data) {
|
||||||
|
wl_list_remove(&listener->link);
|
||||||
|
tablet = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void destroytabletsurfacenotify(struct wl_listener *listener, void *data) {
|
void destroytabletsurfacenotify(struct wl_listener *listener, void *data) {
|
||||||
if (tablet_curr_surface)
|
if (tablet_curr_surface)
|
||||||
|
|
@ -69,10 +72,9 @@ void destroytablettool(struct wl_listener *listener, void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void tabletapplymap(double tablet_width, double tablet_height,
|
void tabletapplymap(double tablet_width, double tablet_height,
|
||||||
struct wlr_fbox box, double *x, double *y)
|
struct wlr_fbox box, double *x, double *y) {
|
||||||
{
|
if ((!box.x && !box.y && !box.width && !box.height) || !tablet_width ||
|
||||||
if ((!box.x && !box.y && !box.width && !box.height)
|
!tablet_height) {
|
||||||
|| !tablet_width || !tablet_height) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,7 +106,7 @@ void tablettoolmotion(struct wlr_tablet_v2_tablet_tool *tool, bool change_x,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tabletapplymap(tablet->wlr_tablet->width_mm, tablet->wlr_tablet->height_mm,
|
tabletapplymap(tablet->wlr_tablet->width_mm, tablet->wlr_tablet->height_mm,
|
||||||
(struct wlr_fbox){0}, &x, &y);
|
(struct wlr_fbox){0}, &x, &y);
|
||||||
|
|
||||||
// TODO: apply constraints
|
// TODO: apply constraints
|
||||||
switch (tablet_tool->wlr_tool->type) {
|
switch (tablet_tool->wlr_tool->type) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue