Commit c49e58e6 authored by Olivier Fourdan's avatar Olivier Fourdan 🛠

events: Allow resizing regardless of modifiers

xfwm4 expects no keyboard modifiers (other than the usual locks) in
button events to allow interactive resizing.

There is no reason to be so picky, especially considering there is no
such check when moving windows.

Relax the requirements for resizing and allow interactive resize with
the mouse regardless of the modifiers being pressed.
Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <fourdan@xfce.org>
Closes: #487
parent c4811949
Pipeline #5616 passed with stages
in 3 minutes and 3 seconds
...@@ -995,43 +995,35 @@ handleButtonPress (DisplayInfo *display_info, XfwmEventButton *event) ...@@ -995,43 +995,35 @@ handleButtonPress (DisplayInfo *display_info, XfwmEventButton *event)
} }
} }
} }
else if ((win == MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT])) else if (win == MYWINDOW_XWINDOW (c->corners[CORNER_TOP_LEFT]))
&& (state == 0))
{ {
edgeButton (c, CORNER_TOP_LEFT, event); edgeButton (c, CORNER_TOP_LEFT, event);
} }
else if ((win == MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT])) else if (win == MYWINDOW_XWINDOW (c->corners[CORNER_TOP_RIGHT]))
&& (state == 0))
{ {
edgeButton (c, CORNER_TOP_RIGHT, event); edgeButton (c, CORNER_TOP_RIGHT, event);
} }
else if ((win == MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT])) else if (win == MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_LEFT]))
&& (state == 0))
{ {
edgeButton (c, CORNER_BOTTOM_LEFT, event); edgeButton (c, CORNER_BOTTOM_LEFT, event);
} }
else if ((win == MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT])) else if (win == MYWINDOW_XWINDOW (c->corners[CORNER_BOTTOM_RIGHT]))
&& (state == 0))
{ {
edgeButton (c, CORNER_BOTTOM_RIGHT, event); edgeButton (c, CORNER_BOTTOM_RIGHT, event);
} }
else if ((win == MYWINDOW_XWINDOW (c->sides[SIDE_BOTTOM])) else if (win == MYWINDOW_XWINDOW (c->sides[SIDE_BOTTOM]))
&& (state == 0))
{ {
edgeButton (c, CORNER_COUNT + SIDE_BOTTOM, event); edgeButton (c, CORNER_COUNT + SIDE_BOTTOM, event);
} }
else if ((win == MYWINDOW_XWINDOW (c->sides[SIDE_TOP])) else if (win == MYWINDOW_XWINDOW (c->sides[SIDE_TOP]))
&& (state == 0))
{ {
edgeButton (c, CORNER_COUNT + SIDE_TOP, event); edgeButton (c, CORNER_COUNT + SIDE_TOP, event);
} }
else if ((win == MYWINDOW_XWINDOW (c->sides[SIDE_LEFT])) else if (win == MYWINDOW_XWINDOW (c->sides[SIDE_LEFT]))
&& (state == 0))
{ {
edgeButton (c, CORNER_COUNT + SIDE_LEFT, event); edgeButton (c, CORNER_COUNT + SIDE_LEFT, event);
} }
else if ((win == MYWINDOW_XWINDOW (c->sides[SIDE_RIGHT])) else if (win == MYWINDOW_XWINDOW (c->sides[SIDE_RIGHT]))
&& (state == 0))
{ {
edgeButton (c, CORNER_COUNT + SIDE_RIGHT, event); edgeButton (c, CORNER_COUNT + SIDE_RIGHT, event);
} }
......
  • This was really quick, chapeau! Is there a reason to not relax that on other things too? I built this commit on Arch and the window resizing on borders work now. But the problems with modifier key + left/right button for moving/resizing and alt + tab remain. Is that something what is planned to be changed or do you think I have just configured something on my system which causes this behavior and is fixable with configuration?

    I just figured out that disabling num lock solves all this issues but I have no clue how to get the num lock without this strange behaviors, although I can understand why this happens.

    Edited by Eiskasten
  • Yes, modifiers are part of keyboard shortcuts, you can't just ignore them there.

    The fix here just hide the underlying problem on your system, that still need to be addressed. Could be anything, from a broken keyboard or even sticky keys. That can be determined with xev when the issue occurs, to determine at least which modifier remains active.

  • Indeed, NumLock is a modifier, but it should be accounted for automatically and not cause any trouble. Do you have any peculiar xkb setting? Specific keyboard layout?

  • I understand, that is true I have a custom keyboard layout as the Austrian layout is not suitable for programming. I do not think that I messed up with any modifier keys but I can share it tomorrow. I did not modify anything except of alphanumeric keys and the rotated colon key.

    But as you said it is a problem with numlock on my system. Interesting that it seems to be the fault although it should not be considered.

  • I have attached my custom keyboard layout. In addition, I tried switching it to the Austrian layout which does not have the numlock problem in both modes. The weird thing is that when I switched back to my custom layout everything worked as intended and there were no problems with numlock ch

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment