mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-03 06:46:38 -04:00
opt: optimize selmon judge
This commit is contained in:
parent
9d90d46144
commit
20bc31d3c9
1 changed files with 21 additions and 21 deletions
42
maomao.c
42
maomao.c
|
|
@ -3487,7 +3487,7 @@ keypress(struct wl_listener *listener, void *data)
|
|||
event->state == WL_KEYBOARD_KEY_STATE_RELEASED &&
|
||||
(keycode == 133 || keycode == 37 || keycode == 64 || keycode == 50 ||
|
||||
keycode == 134 || keycode == 105 || keycode == 108 || keycode == 62) &&
|
||||
selmon->sel) {
|
||||
selmon && selmon->sel) {
|
||||
if (selmon->isoverview && selmon->sel) {
|
||||
toggleoverview(&(Arg){.i = -1});
|
||||
}
|
||||
|
|
@ -3497,7 +3497,7 @@ keypress(struct wl_listener *listener, void *data)
|
|||
if (!locked && event->state == WL_KEYBOARD_KEY_STATE_RELEASED &&
|
||||
(keycode == 133 || keycode == 37 || keycode == 64 || keycode == 50 ||
|
||||
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));
|
||||
}
|
||||
#endif
|
||||
|
|
@ -4904,27 +4904,27 @@ void setsmfact(const Arg *arg) {
|
|||
arrange(selmon, false);
|
||||
}
|
||||
|
||||
void setmon(Client *c, Monitor *m, uint32_t newtags) {
|
||||
Monitor *oldmon = c->mon;
|
||||
void
|
||||
setmon(Client *c, Monitor *m, uint32_t newtags)
|
||||
{
|
||||
Monitor *oldmon = c->mon;
|
||||
|
||||
if (oldmon == m)
|
||||
return;
|
||||
c->mon = m;
|
||||
c->prev = c->geom;
|
||||
if (oldmon == m)
|
||||
return;
|
||||
c->mon = m;
|
||||
c->prev = c->geom;
|
||||
|
||||
/* Scene graph sends surface leave/enter events on move and resize */
|
||||
if (oldmon)
|
||||
arrange(oldmon, false);
|
||||
if (m) {
|
||||
/* Make sure window actually overlaps with the monitor */
|
||||
resize(c, c->geom, 0);
|
||||
c->tags = newtags
|
||||
? newtags
|
||||
: m->tagset[m->seltags]; /* assign tags of target monitor */
|
||||
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
|
||||
setfloating(c, c->isfloating);
|
||||
}
|
||||
focusclient(focustop(selmon), 1);
|
||||
/* Scene graph sends surface leave/enter events on move and resize */
|
||||
if (oldmon)
|
||||
arrange(oldmon,false);
|
||||
if (m) {
|
||||
/* Make sure window actually overlaps with the monitor */
|
||||
resize(c, c->geom, 0);
|
||||
c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
|
||||
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
|
||||
setfloating(c, c->isfloating);
|
||||
}
|
||||
focusclient(focustop(selmon), 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue