Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added _NET_WM_MOVERESIZE handling for the move case #1183

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Jeffrey-P-McAteer
Copy link

Added _NET_WM_MOVERESIZE handling for the move case and an empty function wm_resize_node in case anyone wants to let windows resize themselves.

This change adds the ability for programs like MPV to request that they be moved, see #864.

Tested by doing:

make bspwm && cp bspwm /tmp/
# Switch to tty2
startx /tmp/bspwm
# launch mpv and w+m1 drag without the modifier key

Jeffrey McAteer added 2 commits August 27, 2020 07:26
…tion wm_resize_node in case anyone wants to let windows resize themselves.
src/events.h Outdated
Comment on lines 57 to 68
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
#define _NET_WM_MOVERESIZE_SIZE_TOP 1
#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */
#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These constants are already defined in xcb_ewmh.h.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I updated the changes in d7a31ad. I don't know if github can do a PR as a squashed merge but I'm fine re-committing the 3 changes as 1 because it makes the history cleaner.

…h.h> and renamed the constants to match in events.c
@baskerville
Copy link
Owner

I get the following warnings using GCC:

src/events.c: In function 'wm_move_resize_node':
src/events.c:355:3: warning: range expressions in switch statements are non-standard [-Wpedantic]
   case XCB_EWMH_WM_MOVERESIZE_SIZE_TOPLEFT ... XCB_EWMH_WM_MOVERESIZE_SIZE_LEFT:
   ^~~~
src/events.c: In function 'wm_resize_node':
src/events.c:387:49: warning: unused parameter 'e' [-Wunused-parameter]
 void wm_resize_node(xcb_client_message_event_t* e, coordinates_t loc)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
src/events.c:387:66: warning: unused parameter 'loc' [-Wunused-parameter]
 void wm_resize_node(xcb_client_message_event_t* e, coordinates_t loc)
                                                    ~~~~~~~~~~~~~~^~~

@deeedob
Copy link

deeedob commented Jan 10, 2023

Hey, what's the current state of this? The patch works for me. I think having the _NET_WM_MOVERESIZE atom enabled is kinda important, at least for me :]

@Jeffrey-P-McAteer
Copy link
Author

@deeedob I remember there being community flak about code style when I originally worked on this change, which is why it was never merged in. I have since abandoned the change and moved back to using i3 personally because I like moving client windows which make use of that atom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants