mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding nomodbuttons patch
This commit is contained in:
parent
8aa21b0311
commit
00320fb842
@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
||||
|
||||
### Changelog:
|
||||
|
||||
2020-09-18 - Added the nomodbuttons patch allowing for toggleable mouse button bindings that have no modifiers
|
||||
|
||||
2020-09-10 - Added the anybar patch (with experimental support for dwm bar(s) + anybar)
|
||||
|
||||
2020-09-09 - Added the bar border patch
|
||||
@ -408,6 +410,10 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
||||
- enable modifying dmenu in config.def.h which resulted previously in a compilation error because two lines of code hardcode dmenu into dwm
|
||||
- allows complete removal of dmenu, should you want to do that
|
||||
|
||||
- nomodbuttons
|
||||
- allows for toggleable client button bindings that have no modifiers
|
||||
- this can, for example, allow you to move or resize using the mouse alone without holding down a modifier key, which can be practical if you have extra buttons on your mouse
|
||||
|
||||
- [no_transparent_borders](https://github.com/szatanjl/dwm/commit/1529909466206016f2101457bbf37c67195714c8)
|
||||
- when terminals have transparency then their borders also become transparent
|
||||
- this patch ensures that borders have no transparency
|
||||
|
@ -11,6 +11,9 @@ static const unsigned int snap = 32; /* snap pixel */
|
||||
#if SWALLOW_PATCH
|
||||
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
|
||||
#endif // SWALLOW_PATCH
|
||||
#if NO_MOD_BUTTONS_PATCH
|
||||
static int nomodbuttons = 1; /* allow client mouse button bindings that have no modifier */
|
||||
#endif // NO_MOD_BUTTONS_PATCH
|
||||
#if VANITYGAPS_PATCH
|
||||
static const unsigned int gappih = 20; /* horiz inner gap between windows */
|
||||
static const unsigned int gappiv = 10; /* vert inner gap between windows */
|
||||
@ -893,6 +896,9 @@ static Key keys[] = {
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_k, toggleverticalmax, {0} },
|
||||
{ MODKEY|ControlMask, XK_m, togglemax, {0} },
|
||||
#endif // MAXIMIZE_PATCH
|
||||
#if NO_MOD_BUTTONS_PATCH
|
||||
{ MODKEY|ShiftMask, XK_Escape, togglenomodbuttons, {0} },
|
||||
#endif // NO_MOD_BUTTONS_PATCH
|
||||
#if SCRATCHPADS_PATCH
|
||||
{ MODKEY, XK_grave, togglescratch, {.ui = 0 } },
|
||||
{ MODKEY|ControlMask, XK_grave, togglescratch, {.ui = 1 } },
|
||||
|
6
dwm.c
6
dwm.c
@ -1992,7 +1992,11 @@ grabbuttons(Client *c, int focused)
|
||||
XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
|
||||
BUTTONMASK, GrabModeSync, GrabModeSync, None, None);
|
||||
for (i = 0; i < LENGTH(buttons); i++)
|
||||
if (buttons[i].click == ClkClientWin)
|
||||
if (buttons[i].click == ClkClientWin
|
||||
#if NO_MOD_BUTTONS_PATCH
|
||||
&& (nomodbuttons || buttons[i].mask != 0)
|
||||
#endif // NO_MOD_BUTTONS_PATCH
|
||||
)
|
||||
for (j = 0; j < LENGTH(modifiers); j++)
|
||||
XGrabButton(dpy, buttons[i].button,
|
||||
buttons[i].mask | modifiers[j],
|
||||
|
@ -174,6 +174,9 @@
|
||||
#if MOVESTACK_PATCH
|
||||
#include "movestack.c"
|
||||
#endif
|
||||
#if NO_MOD_BUTTONS_PATCH
|
||||
#include "nomodbuttons.c"
|
||||
#endif
|
||||
#if PERTAG_PATCH
|
||||
#include "pertag.c"
|
||||
#endif
|
||||
|
@ -170,6 +170,9 @@
|
||||
#if MOVESTACK_PATCH
|
||||
#include "movestack.h"
|
||||
#endif
|
||||
#if NO_MOD_BUTTONS_PATCH
|
||||
#include "nomodbuttons.h"
|
||||
#endif
|
||||
#if PERTAG_PATCH
|
||||
#include "pertag.h"
|
||||
#endif
|
||||
|
7
patch/nomodbuttons.c
Normal file
7
patch/nomodbuttons.c
Normal file
@ -0,0 +1,7 @@
|
||||
void
|
||||
togglenomodbuttons(const Arg *arg)
|
||||
{
|
||||
nomodbuttons = !nomodbuttons;
|
||||
if (selmon->sel)
|
||||
grabbuttons(selmon->sel, 1);
|
||||
}
|
1
patch/nomodbuttons.h
Normal file
1
patch/nomodbuttons.h
Normal file
@ -0,0 +1 @@
|
||||
static void togglenomodbuttons(const Arg *arg);
|
@ -646,6 +646,20 @@
|
||||
*/
|
||||
#define NODMENU_PATCH 0
|
||||
|
||||
/* This patch allows for toggleable client button bindings that have no modifiers.
|
||||
* This can, for example, allow you to move or resize using the mouse alone without holding
|
||||
* down a modifier key. This can be practical if you have extra buttons on your mouse.
|
||||
* While you can use button bindings with no modifiers without this patch in a bare dwm,
|
||||
* those buttons are then unavailable for use within the application itself so being able to
|
||||
* toggle these on and off can be necessary in certain situations (e.g. being able to use
|
||||
* back and forward buttons in a browser).
|
||||
|
||||
* Example bindings:
|
||||
* { ClkClientWin, 0, Button8, movemouse, {0} },
|
||||
* { ClkClientWin, 0, Button9, resizemouse, {0} },
|
||||
*/
|
||||
#define NO_MOD_BUTTONS_PATCH 0
|
||||
|
||||
/* When terminals have transparency then their borders also become transparent.
|
||||
* This patch ensures that borders have no transparency. Note that this patch is
|
||||
* only relevant if you are not using the alpha patch.
|
||||
|
Loading…
Reference in New Issue
Block a user