mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-11-05 04:33:12 +00:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d16962424 | ||
|
|
7622bd3187 | ||
|
|
12a5856427 | ||
|
|
4ecb2a9df5 | ||
|
|
5af5dd5e7e | ||
|
|
d3d4da3bd2 | ||
|
|
88c0c68d59 | ||
|
|
d41ecb745c | ||
|
|
52c4fb58ec | ||
|
|
38c7bd7ee8 | ||
|
|
6e1bfa86c7 | ||
|
|
e32535cf97 | ||
|
|
f4249db613 | ||
|
|
b2d2b701d7 | ||
|
|
2c9cb2af1b |
@@ -1,4 +1,4 @@
|
|||||||
_VERSION = 0.10-dev
|
_VERSION = 0.9-dev
|
||||||
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
||||||
|
|
||||||
PKG_CONFIG = pkg-config
|
PKG_CONFIG = pkg-config
|
||||||
@@ -8,21 +8,21 @@ PREFIX = /usr/local
|
|||||||
MANDIR = $(PREFIX)/share/man
|
MANDIR = $(PREFIX)/share/man
|
||||||
DATADIR = $(PREFIX)/share
|
DATADIR = $(PREFIX)/share
|
||||||
|
|
||||||
WLR_INCS = `$(PKG_CONFIG) --cflags wlroots-0.20`
|
WLR_INCS = `$(PKG_CONFIG) --cflags wlroots-0.21`
|
||||||
WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.20`
|
WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.21`
|
||||||
|
|
||||||
# Allow using an alternative wlroots installation
|
# Allow using an alternative wlroots installation
|
||||||
# This has to have all the includes required by wlroots, e.g:
|
# This has to have all the includes required by wlroots, e.g:
|
||||||
# Assuming wlroots git repo is "${PWD}/wlroots" and you only ran "meson setup build && ninja -C build"
|
# Assuming wlroots git repo is "${PWD}/wlroots" and you only ran "meson setup build && ninja -C build"
|
||||||
#WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \
|
# WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \
|
||||||
# -I$(PWD)/wlroots/include
|
# -I$(PWD)/wlroots/include
|
||||||
# Set -rpath to avoid using the wrong library.
|
# Set -rpath to avoid using the wrong library.
|
||||||
#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/build -L$(PWD)/wlroots/build -lwlroots-0.20
|
# WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/build -L$(PWD)/wlroots/build -lwlroots-0.21
|
||||||
|
|
||||||
# Assuming you ran "meson setup --prefix ${PWD}/0.20 build && ninja -C build install"
|
# Assuming you ran "meson setup --prefix ${PWD}/0.21 build && ninja -C build install"
|
||||||
#WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \
|
#WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \
|
||||||
# -I$(PWD)/wlroots/0.20/include/wlroots-0.20
|
# -I$(PWD)/wlroots/0.21/include/wlroots-0.21
|
||||||
#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/0.20/lib64 -L$(PWD)/wlroots/0.20/lib64 -lwlroots-0.20
|
#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/0.21/lib64 -L$(PWD)/wlroots/0.21/lib64 -lwlroots-0.21
|
||||||
|
|
||||||
XWAYLAND =
|
XWAYLAND =
|
||||||
XLIBS =
|
XLIBS =
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
|
#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
|
||||||
#define TAGMASK ((1u << TAGCOUNT) - 1)
|
#define TAGMASK ((1u << TAGCOUNT) - 1)
|
||||||
#define LISTEN(E, L, H) wl_signal_add((E), ((L)->notify = (H), (L)))
|
#define LISTEN(E, L, H) wl_signal_add((E), ((L)->notify = (H), (L)))
|
||||||
#define LISTEN_STATIC(E, H) do { struct wl_listener *_l = ecalloc(1, sizeof(*_l)); _l->notify = (H); wl_signal_add((E), _l); } while (0)
|
#define LISTEN_STATIC(E, H, D) do { StaticListener *_l = ecalloc(1, sizeof(*_l)); _l->listener.notify = (H); _l->data = (D); wl_signal_add((E), &_l->listener); } while (0)
|
||||||
|
|
||||||
/* enums */
|
/* enums */
|
||||||
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
|
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
|
||||||
@@ -263,6 +263,12 @@ typedef struct {
|
|||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
} SessionLock;
|
} SessionLock;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* Must keep this field first */
|
||||||
|
struct wl_listener listener;
|
||||||
|
void *data;
|
||||||
|
} StaticListener;
|
||||||
|
|
||||||
/* function declarations */
|
/* function declarations */
|
||||||
static void applybounds(Client *c, struct wlr_box *bbox);
|
static void applybounds(Client *c, struct wlr_box *bbox);
|
||||||
static void applygeom(Client *c);
|
static void applygeom(Client *c);
|
||||||
@@ -482,6 +488,7 @@ static struct wl_listener request_set_sel = {.notify = setsel};
|
|||||||
static struct wl_listener request_set_cursor_shape = {.notify = setcursorshape};
|
static struct wl_listener request_set_cursor_shape = {.notify = setcursorshape};
|
||||||
static struct wl_listener request_start_drag = {.notify = requeststartdrag};
|
static struct wl_listener request_start_drag = {.notify = requeststartdrag};
|
||||||
static struct wl_listener start_drag = {.notify = startdrag};
|
static struct wl_listener start_drag = {.notify = startdrag};
|
||||||
|
static struct wl_listener drag_icon_destroy = {.notify = destroydragicon};
|
||||||
static struct wl_listener new_session_lock = {.notify = locksession};
|
static struct wl_listener new_session_lock = {.notify = locksession};
|
||||||
static struct wl_listener new_foreign_toplevel_capture_request = {.notify = capturerequest};
|
static struct wl_listener new_foreign_toplevel_capture_request = {.notify = capturerequest};
|
||||||
|
|
||||||
@@ -784,7 +791,7 @@ buttonpress(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
capturerequest(struct wl_listener *listener, void *data)
|
capturerequest(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct wlr_ext_foreign_toplevel_image_capture_source_manager_v1_request *request = data;
|
struct wlr_ext_foreign_toplevel_image_capture_source_manager_v1_request_event *request = data;
|
||||||
Client *view = request->toplevel_handle->data;
|
Client *view = request->toplevel_handle->data;
|
||||||
|
|
||||||
if (!view->image_capture_source) {
|
if (!view->image_capture_source) {
|
||||||
@@ -1047,8 +1054,8 @@ commitnotify(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
commitpopup(struct wl_listener *listener, void *data)
|
commitpopup(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct wlr_surface *surface = data;
|
StaticListener *sl = wl_container_of(listener, sl, listener);
|
||||||
struct wlr_xdg_popup *popup = wlr_xdg_popup_try_from_wlr_surface(surface);
|
struct wlr_xdg_popup *popup = sl->data;
|
||||||
LayerSurface *l = NULL;
|
LayerSurface *l = NULL;
|
||||||
Client *c = NULL;
|
Client *c = NULL;
|
||||||
struct wlr_box box;
|
struct wlr_box box;
|
||||||
@@ -1091,7 +1098,7 @@ void
|
|||||||
createidleinhibitor(struct wl_listener *listener, void *data)
|
createidleinhibitor(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct wlr_idle_inhibitor_v1 *idle_inhibitor = data;
|
struct wlr_idle_inhibitor_v1 *idle_inhibitor = data;
|
||||||
LISTEN_STATIC(&idle_inhibitor->events.destroy, destroyidleinhibitor);
|
LISTEN_STATIC(&idle_inhibitor->events.destroy, destroyidleinhibitor, idle_inhibitor);
|
||||||
|
|
||||||
checkidleinhibitor(NULL);
|
checkidleinhibitor(NULL);
|
||||||
}
|
}
|
||||||
@@ -1365,7 +1372,7 @@ createpopup(struct wl_listener *listener, void *data)
|
|||||||
/* This event is raised when a client (either xdg-shell or layer-shell)
|
/* This event is raised when a client (either xdg-shell or layer-shell)
|
||||||
* creates a new popup. */
|
* creates a new popup. */
|
||||||
struct wlr_xdg_popup *popup = data;
|
struct wlr_xdg_popup *popup = data;
|
||||||
LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
|
LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup, popup);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1423,15 +1430,15 @@ destroydragicon(struct wl_listener *listener, void *data)
|
|||||||
focusclient(focustop(selmon), NULL, 1);
|
focusclient(focustop(selmon), NULL, 1);
|
||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||||
wl_list_remove(&listener->link);
|
wl_list_remove(&listener->link);
|
||||||
free(listener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
destroyidleinhibitor(struct wl_listener *listener, void *data)
|
destroyidleinhibitor(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
/* `data` is the wlr_surface of the idle inhibitor being destroyed,
|
StaticListener *sl = wl_container_of(listener, sl, listener);
|
||||||
* at this point the idle inhibitor is still in the list of the manager */
|
struct wlr_idle_inhibitor_v1 *idle_inhibitor = sl->data;
|
||||||
checkidleinhibitor(wlr_surface_get_root_surface(data));
|
/* At this point the idle inhibitor is still in the list of the manager */
|
||||||
|
checkidleinhibitor(wlr_surface_get_root_surface(idle_inhibitor->surface));
|
||||||
wl_list_remove(&listener->link);
|
wl_list_remove(&listener->link);
|
||||||
free(listener);
|
free(listener);
|
||||||
}
|
}
|
||||||
@@ -1610,7 +1617,6 @@ focusclient(Client *c, LayerSurface *l, int lift)
|
|||||||
/* Don't change border color if there is an exclusive focus or we are
|
/* Don't change border color if there is an exclusive focus or we are
|
||||||
* handling a drag operation */
|
* handling a drag operation */
|
||||||
if (!(old_l && old_l->layer_surface->current.keyboard_interactive == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE)
|
if (!(old_l && old_l->layer_surface->current.keyboard_interactive == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE)
|
||||||
&& !(old_c && client_wants_focus(old_c))
|
|
||||||
&& !seat->drag)
|
&& !seat->drag)
|
||||||
client_set_border_color(c, focuscolor);
|
client_set_border_color(c, focuscolor);
|
||||||
}
|
}
|
||||||
@@ -2853,14 +2859,14 @@ setup(void)
|
|||||||
foreign_toplevel_list = wlr_ext_foreign_toplevel_list_v1_create(dpy,1);
|
foreign_toplevel_list = wlr_ext_foreign_toplevel_list_v1_create(dpy,1);
|
||||||
ext_foreign_toplevel_image_capture_source_manager_v1 =
|
ext_foreign_toplevel_image_capture_source_manager_v1 =
|
||||||
wlr_ext_foreign_toplevel_image_capture_source_manager_v1_create(dpy, 1);
|
wlr_ext_foreign_toplevel_image_capture_source_manager_v1_create(dpy, 1);
|
||||||
wl_signal_add(&ext_foreign_toplevel_image_capture_source_manager_v1->events.new_request,
|
wl_signal_add(&ext_foreign_toplevel_image_capture_source_manager_v1->events.capture_request,
|
||||||
&new_foreign_toplevel_capture_request);
|
&new_foreign_toplevel_capture_request);
|
||||||
|
|
||||||
/* Use decoration protocols to negotiate server-side decorations */
|
/* Use decoration protocols to negotiate server-side decorations */
|
||||||
wlr_server_decoration_manager_set_default_mode(
|
wlr_server_decoration_manager_set_default_mode(
|
||||||
wlr_server_decoration_manager_create(dpy),
|
wlr_server_decoration_manager_create(dpy),
|
||||||
WLR_SERVER_DECORATION_MANAGER_MODE_SERVER);
|
WLR_SERVER_DECORATION_MANAGER_MODE_SERVER);
|
||||||
xdg_decoration_mgr = wlr_xdg_decoration_manager_v1_create(dpy);
|
xdg_decoration_mgr = wlr_xdg_decoration_manager_v1_create(dpy, 2);
|
||||||
wl_signal_add(&xdg_decoration_mgr->events.new_toplevel_decoration, &new_xdg_decoration);
|
wl_signal_add(&xdg_decoration_mgr->events.new_toplevel_decoration, &new_xdg_decoration);
|
||||||
|
|
||||||
pointer_constraints = wlr_pointer_constraints_v1_create(dpy);
|
pointer_constraints = wlr_pointer_constraints_v1_create(dpy);
|
||||||
@@ -3023,7 +3029,7 @@ startdrag(struct wl_listener *listener, void *data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
drag->icon->data = &wlr_scene_drag_icon_create(drag_icon, drag->icon)->node;
|
drag->icon->data = &wlr_scene_drag_icon_create(drag_icon, drag->icon)->node;
|
||||||
LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon);
|
wl_signal_add(&drag->icon->events.destroy, &drag_icon_destroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user