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
c8dbe8bba4
commit
4102bd7dab
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 &&
|
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) {
|
||||||
if (selmon->isoverview && selmon->sel) {
|
if (selmon->isoverview && selmon->sel) {
|
||||||
toggleoverview(&(Arg){.i = -1});
|
toggleoverview(&(Arg){.i = -1});
|
||||||
}
|
}
|
||||||
|
|
@ -3497,7 +3497,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 +4908,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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue