apply alwayscenter patch

This commit is contained in:
korei999 2023-11-29 22:14:29 +02:00
parent f49e94f455
commit 0bbf1f65da
2 changed files with 9 additions and 9 deletions

View file

@ -10,10 +10,6 @@ static const int numlock = 1;
static const int capslock = 0; static const int capslock = 0;
static const int smartborders = 1; static const int smartborders = 1;
static const unsigned int borderpx = 3; /* border pixel of windows */ static const unsigned int borderpx = 3; /* border pixel of windows */
static const unsigned int gappih = 0; /* horiz inner gap between windows */
static const unsigned int gappiv = 0; /* vert inner gap between windows */
static const unsigned int gappoh = 0; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov = 0; /* vert outer gap between windows and screen edge */
static const float bordercolor[] = COLOR(0x00000000); static const float bordercolor[] = COLOR(0x00000000);
static const float focuscolor[] = COLOR(0x7aa6daff); static const float focuscolor[] = COLOR(0x7aa6daff);
static const float urgentcolor[] = COLOR(0xd54e53ff); static const float urgentcolor[] = COLOR(0xd54e53ff);
@ -21,7 +17,7 @@ static const float stickycolor[] = COLOR(0x8abeb7ff);
static const float mixedcolor[] = COLOR(0xb5bd68ff); static const float mixedcolor[] = COLOR(0xb5bd68ff);
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ /* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 0.0}; static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 0.0};
static const float default_opacity = 1.00; static const int center_relative_to_monitor = 1; /* 0 means center floating relative to the window area */
static const char *const autostart[] = { static const char *const autostart[] = {
"/home/korei/.config/dwl/dwlinit.sh", NULL, "/home/korei/.config/dwl/dwlinit.sh", NULL,
@ -34,10 +30,10 @@ static const char *const autostart[] = {
static int log_level = WLR_ERROR; static int log_level = WLR_ERROR;
typedef enum { typedef enum {
VIEW_L = -1, VIEW_L = -1,
VIEW_R = 1, VIEW_R = 1,
SHIFT_L = -2, SHIFT_L = -2,
SHIFT_R = 2, SHIFT_R = 2,
} RotateTags; } RotateTags;
/* keyboard layout change notification for status bar */ /* keyboard layout change notification for status bar */

6
dwl.c
View file

@ -1830,8 +1830,9 @@ mapnotify(struct wl_listener *listener, void *data)
{ {
/* Called when the surface is mapped, or ready to display on-screen. */ /* Called when the surface is mapped, or ready to display on-screen. */
Client *p, *w, *c = wl_container_of(listener, c, map); Client *p, *w, *c = wl_container_of(listener, c, map);
Monitor *m; Monitor *m = selmon;
int i; int i;
struct wlr_box b = center_relative_to_monitor ? m->m : m->w;
/* Create scene tree for this client and its border */ /* Create scene tree for this client and its border */
c->scene = client_surface(c)->data = wlr_scene_tree_create(layers[LyrTile]); c->scene = client_surface(c)->data = wlr_scene_tree_create(layers[LyrTile]);
@ -1870,6 +1871,9 @@ mapnotify(struct wl_listener *listener, void *data)
wl_list_insert(&clients, &c->link); wl_list_insert(&clients, &c->link);
wl_list_insert(&fstack, &c->flink); wl_list_insert(&fstack, &c->flink);
c->geom.x = (b.width - c->geom.width) / 2 + b.x;
c->geom.y = (b.height - c->geom.height) / 2 + b.y;
/* Set initial monitor, tags, floating status, and focus: /* Set initial monitor, tags, floating status, and focus:
* we always consider floating, clients that have parent and thus * we always consider floating, clients that have parent and thus
* we set the same tags and monitor than its parent, if not * we set the same tags and monitor than its parent, if not