mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-11-11 15:43:13 +00:00
Merge branch 'main' into wlroots-next
This commit is contained in:
@@ -279,7 +279,7 @@ client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
|
|||||||
}
|
}
|
||||||
for (size_t i = 0; i < kb->num_keycodes; i++) {
|
for (size_t i = 0; i < kb->num_keycodes; i++) {
|
||||||
uint32_t key = kb->keycodes[i];
|
uint32_t key = kb->keycodes[i];
|
||||||
if (!consumed[key])
|
if (key >= LENGTH(consumed) || !consumed[key])
|
||||||
filtered[size++] = key;
|
filtered[size++] = key;
|
||||||
}
|
}
|
||||||
wlr_seat_keyboard_notify_enter(seat, s, filtered, size, &kb->modifiers);
|
wlr_seat_keyboard_notify_enter(seat, s, filtered, size, &kb->modifiers);
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ static const float rootcolor[] = COLOR(0x222222ff);
|
|||||||
static const float bordercolor[] = COLOR(0x444444ff);
|
static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
static const float focuscolor[] = COLOR(0x005577ff);
|
static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
|
||||||
static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ applybounds(Client *c, struct wlr_box *bbox)
|
|||||||
c->geom.width = MAX(min.width + 2 * (int)c->bw, c->geom.width);
|
c->geom.width = MAX(min.width + 2 * (int)c->bw, c->geom.width);
|
||||||
c->geom.height = MAX(min.height + 2 * (int)c->bw, c->geom.height);
|
c->geom.height = MAX(min.height + 2 * (int)c->bw, c->geom.height);
|
||||||
/* Some clients set their max size to INT_MAX, which does not violate the
|
/* Some clients set their max size to INT_MAX, which does not violate the
|
||||||
* protocol but it's unnecesary, as they can set their max size to zero. */
|
* protocol but it's unnecessary, as they can set their max size to zero. */
|
||||||
if (max.width > 0 && 2 * (int)c->bw <= INT_MAX - max.width) /* Checks for overflow */
|
if (max.width > 0 && 2 * (int)c->bw <= INT_MAX - max.width) /* Checks for overflow */
|
||||||
c->geom.width = MIN(max.width + 2 * (int)c->bw, c->geom.width);
|
c->geom.width = MIN(max.width + 2 * (int)c->bw, c->geom.width);
|
||||||
if (max.height > 0 && 2 * (int)c->bw <= INT_MAX - max.height) /* Checks for overflow */
|
if (max.height > 0 && 2 * (int)c->bw <= INT_MAX - max.height) /* Checks for overflow */
|
||||||
@@ -1707,10 +1707,14 @@ Client *
|
|||||||
focustop(Monitor *m)
|
focustop(Monitor *m)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
wl_list_for_each(c, &fstack, flink) {
|
|
||||||
|
wl_list_for_each(c, &fstack, flink)
|
||||||
|
if (VISIBLEON(c, m) && c->isfullscreen)
|
||||||
|
return c;
|
||||||
|
|
||||||
|
wl_list_for_each(c, &fstack, flink)
|
||||||
if (VISIBLEON(c, m))
|
if (VISIBLEON(c, m))
|
||||||
return c;
|
return c;
|
||||||
}
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1838,7 +1842,8 @@ keypress(struct wl_listener *listener, void *data)
|
|||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
const Key *key = keybinding(group->mods, group->keysyms[i]);
|
const Key *key = keybinding(group->mods, group->keysyms[i]);
|
||||||
if (key) {
|
if (key) {
|
||||||
consumed[event->keycode] = 1;
|
if (event->keycode < LENGTH(consumed))
|
||||||
|
consumed[event->keycode] = 1;
|
||||||
key->func(&key->arg);
|
key->func(&key->arg);
|
||||||
handled = 1;
|
handled = 1;
|
||||||
break;
|
break;
|
||||||
@@ -1855,7 +1860,7 @@ keypress(struct wl_listener *listener, void *data)
|
|||||||
if (handled || input_method_keyboard_grab_forward_key(group, event))
|
if (handled || input_method_keyboard_grab_forward_key(group, event))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (consumed[event->keycode]) {
|
if (event->keycode < LENGTH(consumed) && consumed[event->keycode]) {
|
||||||
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED)
|
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED)
|
||||||
consumed[event->keycode] = 0;
|
consumed[event->keycode] = 0;
|
||||||
return; /* Don't pass to the client the release event of a handled key-press */
|
return; /* Don't pass to the client the release event of a handled key-press */
|
||||||
@@ -1983,8 +1988,6 @@ mapnotify(struct wl_listener *listener, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize client geometry with room for border */
|
/* Initialize client geometry with room for border */
|
||||||
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT |
|
|
||||||
WLR_EDGE_RIGHT);
|
|
||||||
c->geom.width += 2 * c->bw;
|
c->geom.width += 2 * c->bw;
|
||||||
c->geom.height += 2 * c->bw;
|
c->geom.height += 2 * c->bw;
|
||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c)) {
|
||||||
@@ -2024,8 +2027,11 @@ mapnotify(struct wl_listener *listener, void *data)
|
|||||||
unset_fullscreen:
|
unset_fullscreen:
|
||||||
m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
|
m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
|
||||||
wl_list_for_each(w, &clients, link) {
|
wl_list_for_each(w, &clients, link) {
|
||||||
if (w != c && w != p && w->isfullscreen && m == w->mon && (w->tags & c->tags))
|
if (w != c && w != p && w->isfullscreen && m == w->mon && (w->tags & c->tags)) {
|
||||||
setfullscreen(w, 0);
|
setfullscreen(w, 0);
|
||||||
|
/* setmon() focused w because focustop() prefers fullscreen clients */
|
||||||
|
focusclient(focustop(selmon), NULL, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2431,6 +2437,7 @@ rendermon(struct wl_listener *listener, void *data)
|
|||||||
|
|
||||||
wlr_scene_output_commit(m->scene_output, NULL);
|
wlr_scene_output_commit(m->scene_output, NULL);
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
|
wlr_output_schedule_frame(m->wlr_output);
|
||||||
wlr_scene_output_send_frame_done(m->scene_output, &now);
|
wlr_scene_output_send_frame_done(m->scene_output, &now);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2460,6 +2467,7 @@ requestmonstate(struct wl_listener *listener, void *data)
|
|||||||
{
|
{
|
||||||
struct wlr_output_event_request_state *event = data;
|
struct wlr_output_event_request_state *event = data;
|
||||||
wlr_output_commit_state(event->output, event->state);
|
wlr_output_commit_state(event->output, event->state);
|
||||||
|
wlr_output_schedule_frame(event->output);
|
||||||
updatemons(NULL, NULL);
|
updatemons(NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3056,8 +3064,7 @@ tagmon(const Arg *arg)
|
|||||||
void
|
void
|
||||||
tile(Monitor *m)
|
tile(Monitor *m)
|
||||||
{
|
{
|
||||||
unsigned int mw, my, ty;
|
int i, n = 0, mw, my, ty;
|
||||||
int i, n = 0;
|
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
wl_list_for_each(c, &clients, link)
|
wl_list_for_each(c, &clients, link)
|
||||||
@@ -3358,8 +3365,9 @@ updatemons(struct wl_listener *listener, void *data)
|
|||||||
/* Don't move clients to the left output when plugging monitors */
|
/* Don't move clients to the left output when plugging monitors */
|
||||||
arrange(m);
|
arrange(m);
|
||||||
/* make sure fullscreen clients have the right size */
|
/* make sure fullscreen clients have the right size */
|
||||||
if ((c = focustop(m)) && c->isfullscreen)
|
wl_list_for_each(c, &clients, link)
|
||||||
resize(c, m->m, 0);
|
if (c->mon == m && c->isfullscreen)
|
||||||
|
resize(c, m->m, 0);
|
||||||
|
|
||||||
/* Try to re-set the gamma LUT when updating monitors,
|
/* Try to re-set the gamma LUT when updating monitors,
|
||||||
* it's only really needed when enabling a disabled output, but meh. */
|
* it's only really needed when enabling a disabled output, but meh. */
|
||||||
|
|||||||
Reference in New Issue
Block a user