mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-11-04 04:03:14 +00:00
Compare commits
13
Commits
main
..
2d16962424
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d16962424 | ||
|
|
7622bd3187 | ||
|
|
5af5dd5e7e | ||
|
|
d3d4da3bd2 | ||
|
|
88c0c68d59 | ||
|
|
d41ecb745c | ||
|
|
52c4fb58ec | ||
|
|
38c7bd7ee8 | ||
|
|
6e1bfa86c7 | ||
|
|
e32535cf97 | ||
|
|
f4249db613 | ||
|
|
b2d2b701d7 | ||
|
|
2c9cb2af1b |
@@ -12,6 +12,7 @@ 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 */
|
||||||
|
|||||||
@@ -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);
|
||||||
@@ -785,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) {
|
||||||
@@ -1048,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;
|
||||||
@@ -1092,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);
|
||||||
}
|
}
|
||||||
@@ -1366,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
|
||||||
@@ -1429,9 +1435,10 @@ destroydragicon(struct wl_listener *listener, void *data)
|
|||||||
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);
|
||||||
}
|
}
|
||||||
@@ -1700,14 +1707,10 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2856,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);
|
||||||
|
|||||||
Reference in New Issue
Block a user