mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
center patch: adding options to center transient windows
This commit is contained in:
parent
8f06f9a2d5
commit
9fcb63164d
7
dwm.c
7
dwm.c
@ -2318,6 +2318,13 @@ manage(Window w, XWindowAttributes *wa)
|
|||||||
c->bw = borderpx;
|
c->bw = borderpx;
|
||||||
#endif // SETBORDERPX_PATCH
|
#endif // SETBORDERPX_PATCH
|
||||||
#endif // FLOATPOS_PATCH
|
#endif // FLOATPOS_PATCH
|
||||||
|
#if CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH
|
||||||
|
c->x = t->x + WIDTH(t) / 2 - WIDTH(c) / 2;
|
||||||
|
c->y = t->y + HEIGHT(t) / 2 - HEIGHT(c) / 2;
|
||||||
|
#elif CENTER_TRANSIENT_WINDOWS_PATCH
|
||||||
|
c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2;
|
||||||
|
c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2;
|
||||||
|
#endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH
|
||||||
} else {
|
} else {
|
||||||
c->mon = selmon;
|
c->mon = selmon;
|
||||||
#if FLOATPOS_PATCH
|
#if FLOATPOS_PATCH
|
||||||
|
@ -103,6 +103,23 @@
|
|||||||
*/
|
*/
|
||||||
#define CENTER_PATCH 0
|
#define CENTER_PATCH 0
|
||||||
|
|
||||||
|
/* A transient window is one that is meant to be short lived and is usually raised by a
|
||||||
|
* parent window. Such windows are typically dialog boxes and the like.
|
||||||
|
* It should be noted that in dwm transient windows are not subject to normal client rules
|
||||||
|
* and they are always floating by default.
|
||||||
|
* This patch centers transient windows on the screen like the center patch does. Note that
|
||||||
|
* the 6.2 center patch piggy-backed on the updatewindowtype function to ensure that all
|
||||||
|
* dialog boxes were centered, transient or not. This function was removed in relation to
|
||||||
|
* adding wintype as a client rule filter, hence this no longer works out of the box. This
|
||||||
|
* patch restores previous behaviour with the center patch.
|
||||||
|
*/
|
||||||
|
#define CENTER_TRANSIENT_WINDOWS_PATCH 0
|
||||||
|
|
||||||
|
/* As above, except that the transient window is centered within the position of the parent
|
||||||
|
* window, rather than at the center of the screen. This takes precedence over the above patch.
|
||||||
|
*/
|
||||||
|
#define CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH 0
|
||||||
|
|
||||||
/* This patch centers the WM_NAME of the currently selected window on the status bar.
|
/* This patch centers the WM_NAME of the currently selected window on the status bar.
|
||||||
* Both fancybar and awesomebar patches take precedence over this patch.
|
* Both fancybar and awesomebar patches take precedence over this patch.
|
||||||
* https://dwm.suckless.org/patches/centeredwindowname/
|
* https://dwm.suckless.org/patches/centeredwindowname/
|
||||||
|
Loading…
Reference in New Issue
Block a user