Merge branch 'DreamMaoMao:wlroots-0.19' into wlroots-0.19

This commit is contained in:
Eden 2025-03-25 21:34:00 +08:00 committed by GitHub
commit 45209daa54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3131,10 +3131,6 @@ void focusclient(Client *c, int lift) {
if (c && client_surface(c) == old_keyboard_focus_surface) if (c && client_surface(c) == old_keyboard_focus_surface)
return; return;
if (c && c->mon && c->mon != selmon) {
selmon = c->mon;
}
if (selmon && selmon->sel && selmon->sel->foreign_toplevel) { if (selmon && selmon->sel && selmon->sel->foreign_toplevel) {
wlr_foreign_toplevel_handle_v1_set_activated(selmon->sel->foreign_toplevel, wlr_foreign_toplevel_handle_v1_set_activated(selmon->sel->foreign_toplevel,
false); false);
@ -3497,7 +3493,7 @@ keypress(struct wl_listener *listener, void *data)
if (!locked && event->state == WL_KEYBOARD_KEY_STATE_RELEASED && if (!locked && event->state == WL_KEYBOARD_KEY_STATE_RELEASED &&
(keycode == 133 || keycode == 37 || keycode == 64 || keycode == 50 || (keycode == 133 || keycode == 37 || keycode == 64 || keycode == 50 ||
keycode == 134 || keycode == 105 || keycode == 108 || keycode == 62) && keycode == 134 || keycode == 105 || keycode == 108 || keycode == 62) &&
selmon->sel) { selmon && selmon->sel) {
dwl_input_method_relay_set_focus(input_relay, client_surface(selmon->sel)); dwl_input_method_relay_set_focus(input_relay, client_surface(selmon->sel));
} }
#endif #endif
@ -4908,27 +4904,27 @@ void setsmfact(const Arg *arg) {
arrange(selmon, false); arrange(selmon, false);
} }
void setmon(Client *c, Monitor *m, uint32_t newtags) { void
Monitor *oldmon = c->mon; setmon(Client *c, Monitor *m, uint32_t newtags)
{
Monitor *oldmon = c->mon;
if (oldmon == m) if (oldmon == m)
return; return;
c->mon = m; c->mon = m;
c->prev = c->geom; c->prev = c->geom;
/* Scene graph sends surface leave/enter events on move and resize */ /* Scene graph sends surface leave/enter events on move and resize */
if (oldmon) if (oldmon)
arrange(oldmon, false); arrange(oldmon,false);
if (m) { if (m) {
/* Make sure window actually overlaps with the monitor */ /* Make sure window actually overlaps with the monitor */
resize(c, c->geom, 0); resize(c, c->geom, 0);
c->tags = newtags c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
? newtags setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
: m->tagset[m->seltags]; /* assign tags of target monitor */ setfloating(c, c->isfloating);
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */ }
setfloating(c, c->isfloating); focusclient(focustop(selmon), 1);
}
focusclient(focustop(selmon), 1);
} }
void void