mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 12:05:45 +00:00
Adding decoration hints patch
This commit is contained in:
parent
14e148be2a
commit
10f4d513ec
@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
|
2020-08-11 - Added decoration hints patch
|
||||||
|
|
||||||
2020-08-10 - Added cool autostart, insets and steam patches
|
2020-08-10 - Added cool autostart, insets and steam patches
|
||||||
|
|
||||||
2020-08-02 - Added reorganizetags patch
|
2020-08-02 - Added reorganizetags patch
|
||||||
@ -208,6 +210,11 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
- [cyclelayouts](https://dwm.suckless.org/patches/cyclelayouts/)
|
- [cyclelayouts](https://dwm.suckless.org/patches/cyclelayouts/)
|
||||||
- lets you cycle through all your layouts
|
- lets you cycle through all your layouts
|
||||||
|
|
||||||
|
- [decoration_hints](https://dwm.suckless.org/patches/decoration_hints/)
|
||||||
|
- make dwm respect \_MOTIF\_WM\_HINTS property, and not draw borders around windows requesting for it
|
||||||
|
- some applications use this property to notify window managers to not draw window decorations
|
||||||
|
- not respecting this property leads to issues with applications that draw their own borders, like chromium (with "Use system title bar and borders" turned off) or vlc in fullscreen mode
|
||||||
|
|
||||||
- [dmenumatchtop](https://dwm.suckless.org/patches/dmenumatchtop)
|
- [dmenumatchtop](https://dwm.suckless.org/patches/dmenumatchtop)
|
||||||
- updates the position of dmenu to match that of the bar
|
- updates the position of dmenu to match that of the bar
|
||||||
- i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at the top
|
- i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at the top
|
||||||
|
@ -654,6 +654,9 @@ static const int nmaster = 1; /* number of clients in master area */
|
|||||||
static const int nstack = 0; /* number of clients in primary stack area */
|
static const int nstack = 0; /* number of clients in primary stack area */
|
||||||
#endif // FLEXTILE_DELUXE_LAYOUT
|
#endif // FLEXTILE_DELUXE_LAYOUT
|
||||||
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
|
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
|
||||||
|
#if DECORATION_HINTS_PATCH
|
||||||
|
static const int decorhints = 1; /* 1 means respect decoration hints */
|
||||||
|
#endif // DECORATION_HINTS_PATCH
|
||||||
|
|
||||||
#if NROWGRID_LAYOUT
|
#if NROWGRID_LAYOUT
|
||||||
#define FORCE_VSPLIT 1
|
#define FORCE_VSPLIT 1
|
||||||
|
10
dwm.c
10
dwm.c
@ -2033,6 +2033,9 @@ manage(Window w, XWindowAttributes *wa)
|
|||||||
if (getatomprop(c, netatom[NetWMState]) == netatom[NetWMFullscreen])
|
if (getatomprop(c, netatom[NetWMState]) == netatom[NetWMFullscreen])
|
||||||
setfullscreen(c, 1);
|
setfullscreen(c, 1);
|
||||||
updatewmhints(c);
|
updatewmhints(c);
|
||||||
|
#if DECORATION_HINTS_PATCH
|
||||||
|
updatemotifhints(c);
|
||||||
|
#endif // DECORATION_HINTS_PATCH
|
||||||
#if CENTER_PATCH
|
#if CENTER_PATCH
|
||||||
if (c->iscentered) {
|
if (c->iscentered) {
|
||||||
c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2;
|
c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2;
|
||||||
@ -2300,6 +2303,10 @@ propertynotify(XEvent *e)
|
|||||||
if (c == c->mon->sel)
|
if (c == c->mon->sel)
|
||||||
drawbar(c->mon);
|
drawbar(c->mon);
|
||||||
}
|
}
|
||||||
|
#if DECORATION_HINTS_PATCH
|
||||||
|
if (ev->atom == motifatom)
|
||||||
|
updatemotifhints(c);
|
||||||
|
#endif // DECORATION_HINTS_PATCH
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2933,6 +2940,9 @@ setup(void)
|
|||||||
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
|
netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
|
||||||
netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
|
netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
|
||||||
|
#if DECORATION_HINTS_PATCH
|
||||||
|
motifatom = XInternAtom(dpy, "_MOTIF_WM_HINTS", False);
|
||||||
|
#endif // DECORATION_HINTS_PATCH
|
||||||
/* init cursors */
|
/* init cursors */
|
||||||
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
||||||
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
||||||
|
34
patch/decorationhints.c
Normal file
34
patch/decorationhints.c
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
static Atom motifatom;
|
||||||
|
|
||||||
|
void
|
||||||
|
updatemotifhints(Client *c)
|
||||||
|
{
|
||||||
|
Atom real;
|
||||||
|
int format;
|
||||||
|
unsigned char *p = NULL;
|
||||||
|
unsigned long n, extra;
|
||||||
|
unsigned long *motif;
|
||||||
|
int width, height;
|
||||||
|
|
||||||
|
if (!decorhints)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (XGetWindowProperty(dpy, c->win, motifatom, 0L, 5L, False, motifatom,
|
||||||
|
&real, &format, &n, &extra, &p) == Success && p != NULL) {
|
||||||
|
motif = (unsigned long*)p;
|
||||||
|
if (motif[MWM_HINTS_FLAGS_FIELD] & MWM_HINTS_DECORATIONS) {
|
||||||
|
width = WIDTH(c);
|
||||||
|
height = HEIGHT(c);
|
||||||
|
|
||||||
|
if (motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_ALL ||
|
||||||
|
motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_BORDER ||
|
||||||
|
motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_TITLE)
|
||||||
|
c->bw = c->oldbw = borderpx;
|
||||||
|
else
|
||||||
|
c->bw = c->oldbw = 0;
|
||||||
|
|
||||||
|
resize(c, c->x, c->y, width - (2*c->bw), height - (2*c->bw), 0);
|
||||||
|
}
|
||||||
|
XFree(p);
|
||||||
|
}
|
||||||
|
}
|
8
patch/decorationhints.h
Normal file
8
patch/decorationhints.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#define MWM_HINTS_FLAGS_FIELD 0
|
||||||
|
#define MWM_HINTS_DECORATIONS_FIELD 2
|
||||||
|
#define MWM_HINTS_DECORATIONS (1 << 1)
|
||||||
|
#define MWM_DECOR_ALL (1 << 0)
|
||||||
|
#define MWM_DECOR_BORDER (1 << 1)
|
||||||
|
#define MWM_DECOR_TITLE (1 << 3)
|
||||||
|
|
||||||
|
static void updatemotifhints(Client *c);
|
@ -82,6 +82,9 @@
|
|||||||
#if CYCLELAYOUTS_PATCH
|
#if CYCLELAYOUTS_PATCH
|
||||||
#include "cyclelayouts.c"
|
#include "cyclelayouts.c"
|
||||||
#endif
|
#endif
|
||||||
|
#if DECORATION_HINTS_PATCH
|
||||||
|
#include "decorationhints.c"
|
||||||
|
#endif
|
||||||
#if DRAGCFACT_PATCH && CFACTS_PATCH
|
#if DRAGCFACT_PATCH && CFACTS_PATCH
|
||||||
#include "dragcfact.c"
|
#include "dragcfact.c"
|
||||||
#endif
|
#endif
|
||||||
|
@ -79,6 +79,9 @@
|
|||||||
#if CYCLELAYOUTS_PATCH
|
#if CYCLELAYOUTS_PATCH
|
||||||
#include "cyclelayouts.h"
|
#include "cyclelayouts.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if DECORATION_HINTS_PATCH
|
||||||
|
#include "decorationhints.h"
|
||||||
|
#endif
|
||||||
#if DRAGCFACT_PATCH && CFACTS_PATCH
|
#if DRAGCFACT_PATCH && CFACTS_PATCH
|
||||||
#include "dragcfact.h"
|
#include "dragcfact.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -348,6 +348,15 @@
|
|||||||
*/
|
*/
|
||||||
#define CYCLELAYOUTS_PATCH 0
|
#define CYCLELAYOUTS_PATCH 0
|
||||||
|
|
||||||
|
/* Make dwm respect _MOTIF_WM_HINTS property, and not draw borders around windows requesting
|
||||||
|
* for it. Some applications use this property to notify window managers to not draw window
|
||||||
|
* decorations.
|
||||||
|
* Not respecting this property leads to issues with applications that draw their own borders,
|
||||||
|
* like chromium (with "Use system title bar and borders" turned off) or vlc in fullscreen mode.
|
||||||
|
* https://dwm.suckless.org/patches/decoration_hints/
|
||||||
|
*/
|
||||||
|
#define DECORATION_HINTS_PATCH 0
|
||||||
|
|
||||||
/* Similarly to the dragmfact patch this allows you to click and drag clients to change the
|
/* Similarly to the dragmfact patch this allows you to click and drag clients to change the
|
||||||
* cfact to adjust the client's size in the stack. This patch depends on the cfacts patch.
|
* cfact to adjust the client's size in the stack. This patch depends on the cfacts patch.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user