mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-11-04 04:03:14 +00:00
Compare commits
6
Commits
v0.9
..
f22c223cbf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f22c223cbf | ||
|
|
b83881f881 | ||
|
|
fa400c5d3d | ||
|
|
40b0ae76ae | ||
|
|
2a567195e6 | ||
|
|
cc23250527 |
@@ -189,6 +189,7 @@ client_get_geometry(Client *c, struct wlr_box *geom)
|
||||
}
|
||||
#endif
|
||||
*geom = c->surface.xdg->geometry;
|
||||
geom->x = geom->y = 0;
|
||||
}
|
||||
|
||||
static inline Client *
|
||||
|
||||
+4
-1
@@ -172,6 +172,9 @@ static const Button buttons[] = {
|
||||
};
|
||||
|
||||
static const Axis axes[] = {
|
||||
/* example of volume control:
|
||||
{ MODKEY, AxisUp, spawn, SHCMD("volume-up_EXAMPLE") },
|
||||
{ MODKEY, AxisDown, spawn, SHCMD("volume-down_EXAMPLE") },
|
||||
{ MODKEY, AxisDown, spawn, SHCMD("volume-down_EXAMPLE") }, */
|
||||
{ 0, 0, NULL, {0} },
|
||||
/* does nothing, but the array cannot be empty */
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
_VERSION = 0.9-dev
|
||||
_VERSION = 0.10-dev
|
||||
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
||||
|
||||
PKG_CONFIG = pkg-config
|
||||
|
||||
@@ -211,6 +211,7 @@ struct Monitor {
|
||||
struct wl_listener frame;
|
||||
struct wl_listener destroy;
|
||||
struct wl_listener request_state;
|
||||
struct wl_listener commit_lock_surface;
|
||||
struct wl_listener destroy_lock_surface;
|
||||
struct wlr_session_lock_surface_v1 *lock_surface;
|
||||
struct wlr_box m; /* monitor area, layout-relative */
|
||||
@@ -276,6 +277,7 @@ static void cleanupmon(struct wl_listener *listener, void *data);
|
||||
static void cleanuplisteners(void);
|
||||
static void closemon(Monitor *m);
|
||||
static void commitlayersurfacenotify(struct wl_listener *listener, void *data);
|
||||
static void commitlocksurface(struct wl_listener *listener, void *data);
|
||||
static void commitnotify(struct wl_listener *listener, void *data);
|
||||
static void commitpopup(struct wl_listener *listener, void *data);
|
||||
static void createdecoration(struct wl_listener *listener, void *data);
|
||||
@@ -663,16 +665,18 @@ axisnotify(struct wl_listener *listener, void *data)
|
||||
|
||||
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
|
||||
|
||||
if (event->orientation == WL_POINTER_AXIS_VERTICAL_SCROLL)
|
||||
adir = event->delta > 0 ? AxisDown : AxisUp;
|
||||
else
|
||||
adir = event->delta > 0 ? AxisRight : AxisLeft;
|
||||
keyboard = wlr_seat_get_keyboard(seat);
|
||||
mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
|
||||
for (a = axes; a < END(axes); a++) {
|
||||
if (CLEANMASK(mods) == CLEANMASK(a->mod) && adir == a->dir && a->func) {
|
||||
a->func(&a->arg);
|
||||
return;
|
||||
if (!locked) {
|
||||
if (event->orientation == WL_POINTER_AXIS_VERTICAL_SCROLL)
|
||||
adir = event->delta > 0 ? AxisDown : AxisUp;
|
||||
else
|
||||
adir = event->delta > 0 ? AxisRight : AxisLeft;
|
||||
keyboard = wlr_seat_get_keyboard(seat);
|
||||
mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
|
||||
for (a = axes; a < END(axes); a++) {
|
||||
if (CLEANMASK(mods) == CLEANMASK(a->mod) && adir == a->dir && a->func) {
|
||||
a->func(&a->arg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -951,6 +955,20 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data)
|
||||
arrangelayers(l->mon);
|
||||
}
|
||||
|
||||
void
|
||||
commitlocksurface(struct wl_listener *listener, void *data)
|
||||
{
|
||||
Monitor *m = wl_container_of(listener, m, commit_lock_surface);
|
||||
|
||||
if (!m->lock_surface->surface->mapped)
|
||||
return;
|
||||
|
||||
wl_list_remove(&m->commit_lock_surface.link);
|
||||
wl_list_init(&m->commit_lock_surface.link);
|
||||
|
||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
commitnotify(struct wl_listener *listener, void *data)
|
||||
{
|
||||
@@ -1128,6 +1146,7 @@ createlocksurface(struct wl_listener *listener, void *data)
|
||||
wlr_session_lock_surface_v1_configure(lock_surface, m->m.width, m->m.height);
|
||||
|
||||
LISTEN(&lock_surface->events.destroy, &m->destroy_lock_surface, destroylocksurface);
|
||||
LISTEN(&lock_surface->surface->events.commit, &m->commit_lock_surface, commitlocksurface);
|
||||
|
||||
if (m == selmon)
|
||||
client_notify_enter(lock_surface->surface, wlr_seat_get_keyboard(seat));
|
||||
@@ -1409,6 +1428,7 @@ destroylocksurface(struct wl_listener *listener, void *data)
|
||||
|
||||
m->lock_surface = NULL;
|
||||
wl_list_remove(&m->destroy_lock_surface.link);
|
||||
wl_list_remove(&m->commit_lock_surface.link);
|
||||
|
||||
if (lock_surface->surface != seat->keyboard_state.focused_surface)
|
||||
return;
|
||||
@@ -1810,7 +1830,7 @@ int
|
||||
keyrepeat(void *data)
|
||||
{
|
||||
KeyboardGroup *group = data;
|
||||
if (group->wlr_group->keyboard.repeat_info.rate <= 0)
|
||||
if (locked || group->wlr_group->keyboard.repeat_info.rate <= 0)
|
||||
return 0;
|
||||
|
||||
wl_event_source_timer_update(group->key_repeat_source,
|
||||
@@ -1852,6 +1872,12 @@ locksession(struct wl_listener *listener, void *data)
|
||||
cur_lock = lock->lock = session_lock;
|
||||
locked = 1;
|
||||
|
||||
/* Cancel any interactive move/resize and take the pointer focus away
|
||||
* from the clients below the lock screen */
|
||||
cursor_mode = CurNormal;
|
||||
grabc = NULL;
|
||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||
|
||||
LISTEN(&session_lock->events.new_surface, &lock->new_surface, createlocksurface);
|
||||
LISTEN(&session_lock->events.destroy, &lock->destroy, destroysessionlock);
|
||||
LISTEN(&session_lock->events.unlock, &lock->unlock, unlocksession);
|
||||
@@ -3221,7 +3247,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
|
||||
struct wlr_surface *surface = NULL;
|
||||
int layer;
|
||||
|
||||
for (layer = NUM_LAYERS - 1; !surface && layer >= 0; layer--) {
|
||||
for (layer = NUM_LAYERS - 1; !surface && layer >= (locked ? LyrBlock : 0); layer--) {
|
||||
if (layer == LyrIMPopup ||
|
||||
!(node = wlr_scene_node_at(&layers[layer]->node, x, y, nx, ny)))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user