Skip to content

Commit 216b185

Browse files
committed
Add replay_click_on_focus config key
And also bump the version goddamit
1 parent f27f774 commit 216b185

File tree

10 files changed

+28
-4
lines changed

10 files changed

+28
-4
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.2
1+
0.4.1

client.c

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ static struct ConfigEntry configs[] = {
9696
{ "enable_borders" , IPCConfigEnableBorders , 1 , fn_bool },
9797
{ "enable_last_window_focusing", IPCConfigEnableLastWindowFocusing, 1 , fn_bool },
9898
{ "apply_settings" , IPCConfigApplySettings , 1 , fn_bool },
99+
{ "replay_click_on_focus" , IPCConfigReplayClickOnFocus, 1, fn_bool },
99100
{ "pointer_actions" , IPCConfigPointerActions , 3 , fn_pac },
100101
{ "pointer_modifier" , IPCConfigPointerModifier , 1 , fn_mod },
101102
{ "click_to_focus" , IPCConfigClickToFocus , 1 , fn_button },

config.h

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
/* if true, apply settings on windows when they are set (like border color, border width) */
4141
#define APPLY_SETTINGS true
4242

43+
/* When clicking a window to focus it, send the click to it too. */
44+
#define REPLAY_CLICK_ON_FOCUS true
45+
4346
/* default pointer actions */
4447
#define DEFAULT_LEFT_BUTTON_ACTION POINTER_ACTION_MOVE
4548
#define DEFAULT_MIDDLE_BUTTON_ACTION POINTER_ACTION_RESIZE_SIDE

examples/windowchefrc

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ waitron wm_config sticky_windows false
1313
waitron wm_config enable_borders true
1414
waitron wm_config enable_last_window_focusing true
1515
waitron wm_config apply_settings true
16+
waitron wm_config replay_click_on_focus true
1617
waitron wm_config pointer_actions move resize_side resize_corner
1718
waitron wm_config pointer_modifier super
1819
waitron wm_config click_to_focus any

ipc.h

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ enum IPCConfig {
5555
IPCConfigEnableBorders,
5656
IPCConfigEnableLastWindowFocusing,
5757
IPCConfigApplySettings,
58+
IPCConfigReplayClickOnFocus,
5859
IPCConfigPointerActions,
5960
IPCConfigPointerModifier,
6061
IPCConfigClickToFocus,

man/waitron.1

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" generated with Ronn/v0.7.3
22
.\" https://github.com/rtomayko/ronn/tree/0.7.3
33
.
4-
.TH "WAITRON" "1" "August 2017" "Windowchef" "Windowchef Manual"
4+
.TH "WAITRON" "1" "September 2017" "Windowchef" "Windowchef Manual"
55
.
66
.SH "NAME"
77
\fBwaitron\fR \- A client for windowchef(1)
@@ -247,6 +247,10 @@ If true, when the currently focused window is unmapped or closed, \fBwindowchef\
247247
If true, then some settings will be applied on all windows instead of newly created windows\. True by default\.
248248
.
249249
.TP
250+
\fBreplay_click_on_focus\fR \fIBOOL\fR
251+
If true, when clicking on an unfocused with the intent to focus it, windowchef will also send the click event to the target window\. If false, the window will receive the click event only if it\'s already focused\.
252+
.
253+
.TP
250254
\fBpointer_actions\fR \fIPOINTER_ACTION\fR \fIPOINTER_ACTION\fR \fIPOINTER_ACTION\fR
251255
Sets the action that should be done whenever the modifier key and the corresponding button are clicked at the same time on the window\. There are 3 actions for three mouse buttons: left, middle and right\.
252256
.

man/waitron.1.html

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/waitron.1.md

+5
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ are:
215215
If true, then some settings will be applied on all windows instead of newly created windows.
216216
True by default.
217217

218+
* `replay_click_on_focus` <BOOL>:
219+
If true, when clicking on an unfocused with the intent to focus it, windowchef will also send
220+
the click event to the target window. If false, the window will receive the click event only
221+
if it's already focused.
222+
218223
* `pointer_actions` <POINTER_ACTION> <POINTER_ACTION> <POINTER_ACTION>:
219224
Sets the action that should be done whenever the modifier key and the corresponding button
220225
are clicked at the same time on the window. There are 3 actions for three mouse buttons:

types.h

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ struct conf {
9898
bool borders;
9999
bool last_window_focusing;
100100
bool apply_settings;
101+
bool replay_click_on_focus;
101102
enum pointer_action pointer_actions[3];
102103
uint16_t pointer_modifier;
103104
int8_t click_to_focus;

wm.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -2996,6 +2996,9 @@ ipc_wm_config(uint32_t *d)
29962996
case IPCConfigApplySettings:
29972997
conf.apply_settings = d[1];
29982998
break;
2999+
case IPCConfigReplayClickOnFocus:
3000+
conf.replay_click_on_focus = d[1];
3001+
break;
29993002
case IPCConfigPointerActions:
30003003
for (int i = 0; i < NR_BUTTONS; i++) {
30013004
conf.pointer_actions[i] = d[i + 1];
@@ -3138,7 +3141,8 @@ pointer_grab(enum pointer_action pac)
31383141
DMSG("grabbing pointer to focus on 0x%08x\n", client->window);
31393142
if (client != focused_win) {
31403143
set_focused(client);
3141-
return true;
3144+
if (!conf.replay_click_on_focus)
3145+
return true;
31423146
}
31433147
return false;
31443148
}
@@ -3387,6 +3391,7 @@ load_defaults(void)
33873391
conf.borders = BORDERS;
33883392
conf.last_window_focusing = LAST_WINDOW_FOCUSING;
33893393
conf.apply_settings = APPLY_SETTINGS;
3394+
conf.replay_click_on_focus = REPLAY_CLICK_ON_FOCUS;
33903395
conf.pointer_actions[BUTTON_LEFT] = DEFAULT_LEFT_BUTTON_ACTION;
33913396
conf.pointer_actions[BUTTON_MIDDLE] = DEFAULT_MIDDLE_BUTTON_ACTION;
33923397
conf.pointer_actions[BUTTON_RIGHT] = DEFAULT_RIGHT_BUTTON_ACTION;

0 commit comments

Comments
 (0)