mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-02 07:15:55 -04:00
opt: check kde atom _kde_net_wm_window_type_override)
This commit is contained in:
parent
1e1d41e626
commit
0eed59406c
2 changed files with 28 additions and 1 deletions
|
|
@ -448,8 +448,23 @@ static inline int32_t client_should_overtop(Client *c) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
extra_xwayland_surface_has_window_type(struct wlr_xwayland_surface *surface,
|
||||
xcb_atom_t atom) {
|
||||
for (size_t i = 0; i < surface->window_type_len; i++) {
|
||||
if (surface->window_type[i] == atom)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int32_t client_wants_focus(Client *c) {
|
||||
#ifdef XWAYLAND
|
||||
|
||||
if (extra_xwayland_surface_has_window_type(
|
||||
c->surface.xwayland, atom_kde_net_wm_window_type_override))
|
||||
return false;
|
||||
|
||||
return client_is_unmanaged(c) &&
|
||||
wlr_xwayland_surface_override_redirect_wants_focus(
|
||||
c->surface.xwayland) &&
|
||||
|
|
|
|||
14
src/mango.c
14
src/mango.c
|
|
@ -919,7 +919,6 @@ static struct {
|
|||
int32_t hotspot_y;
|
||||
} last_cursor;
|
||||
|
||||
#include "client/client.h"
|
||||
#include "config/preset.h"
|
||||
|
||||
struct Pertag {
|
||||
|
|
@ -988,12 +987,14 @@ static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11};
|
|||
static struct wl_listener xwayland_ready = {.notify = xwaylandready};
|
||||
static struct wlr_xwayland *xwayland;
|
||||
static struct wl_event_source *sync_keymap;
|
||||
static xcb_atom_t atom_kde_net_wm_window_type_override;
|
||||
#endif
|
||||
|
||||
#include "animation/client.h"
|
||||
#include "animation/common.h"
|
||||
#include "animation/layer.h"
|
||||
#include "animation/tag.h"
|
||||
#include "client/client.h"
|
||||
#include "config/parse_config.h"
|
||||
#include "dispatch/bind_define.h"
|
||||
#include "ext-protocol/all.h"
|
||||
|
|
@ -6552,6 +6553,17 @@ void xwaylandready(struct wl_listener *listener, void *data) {
|
|||
/* xwayland can't auto sync the keymap, so we do it manually
|
||||
and we need to wait the xwayland completely inited
|
||||
*/
|
||||
|
||||
xcb_connection_t *xcb_conn =
|
||||
xcb_connect(NULL, NULL); // 或从 wlr_xwayland 获取
|
||||
xcb_intern_atom_cookie_t cookie =
|
||||
xcb_intern_atom(xcb_conn, 0, strlen("_KDE_NET_WM_WINDOW_TYPE_OVERRIDE"),
|
||||
"_KDE_NET_WM_WINDOW_TYPE_OVERRIDE");
|
||||
xcb_intern_atom_reply_t *reply =
|
||||
xcb_intern_atom_reply(xcb_conn, cookie, NULL);
|
||||
atom_kde_net_wm_window_type_override = reply->atom;
|
||||
free(reply);
|
||||
|
||||
wl_event_source_timer_update(sync_keymap, 500);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue