fix: xwayland drag icon position can't update
This commit is contained in:
25
src/maomao.c
25
src/maomao.c
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* See LICENSE file for copyright and license details.
|
* See LICENSE file for copyright and license details.
|
||||||
*/
|
*/
|
||||||
|
#include "wlr/util/box.h"
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <libinput.h>
|
#include <libinput.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -233,6 +234,7 @@ struct Client {
|
|||||||
struct wl_listener dissociate;
|
struct wl_listener dissociate;
|
||||||
struct wl_listener configure;
|
struct wl_listener configure;
|
||||||
struct wl_listener set_hints;
|
struct wl_listener set_hints;
|
||||||
|
struct wl_listener set_geometry;
|
||||||
#endif
|
#endif
|
||||||
unsigned int bw;
|
unsigned int bw;
|
||||||
unsigned int tags, oldtags, mini_restore_tag;
|
unsigned int tags, oldtags, mini_restore_tag;
|
||||||
@@ -795,10 +797,9 @@ static void dissociatex11(struct wl_listener *listener, void *data);
|
|||||||
static void associatex11(struct wl_listener *listener, void *data);
|
static void associatex11(struct wl_listener *listener, void *data);
|
||||||
static void sethints(struct wl_listener *listener, void *data);
|
static void sethints(struct wl_listener *listener, void *data);
|
||||||
static void xwaylandready(struct wl_listener *listener, void *data);
|
static void xwaylandready(struct wl_listener *listener, void *data);
|
||||||
|
static void setgeometrynotify(struct wl_listener *listener, void *data);
|
||||||
static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11};
|
static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11};
|
||||||
static struct wl_listener xwayland_ready = {.notify = xwaylandready};
|
static struct wl_listener xwayland_ready = {.notify = xwaylandready};
|
||||||
// static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11};
|
|
||||||
// static struct wl_listener xwayland_ready = {.notify = xwaylandready};
|
|
||||||
static struct wlr_xwayland *xwayland;
|
static struct wlr_xwayland *xwayland;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -4470,6 +4471,12 @@ mapnotify(struct wl_listener *listener, void *data) {
|
|||||||
focusclient(c, 1);
|
focusclient(c, 1);
|
||||||
exclusive_focus = c;
|
exclusive_focus = c;
|
||||||
}
|
}
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c)) {
|
||||||
|
LISTEN(&c->surface.xwayland->events.set_geometry, &c->set_geometry,
|
||||||
|
setgeometrynotify);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6764,6 +6771,11 @@ void unmapnotify(struct wl_listener *listener, void *data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (client_is_unmanaged(c)) {
|
if (client_is_unmanaged(c)) {
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if(client_is_x11(c)) {
|
||||||
|
wl_list_remove(&c->set_geometry.link);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (c == exclusive_focus)
|
if (c == exclusive_focus)
|
||||||
exclusive_focus = NULL;
|
exclusive_focus = NULL;
|
||||||
if (client_surface(c) == seat->keyboard_state.focused_surface)
|
if (client_surface(c) == seat->keyboard_state.focused_surface)
|
||||||
@@ -7665,6 +7677,15 @@ void xwaylandready(struct wl_listener *listener, void *data) {
|
|||||||
xcursor->images[0]->width, xcursor->images[0]->height,
|
xcursor->images[0]->width, xcursor->images[0]->height,
|
||||||
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void setgeometrynotify(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
|
Client *c = wl_container_of(listener, c, set_geometry);
|
||||||
|
|
||||||
|
struct wlr_xwayland_surface *xsurface = c->surface.xwayland;
|
||||||
|
wlr_scene_node_set_position(&c->scene->node, xsurface->x, xsurface->y);
|
||||||
|
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user