IABSD.fr/xenocara/app/cwm/xevents.c

Branch :


Log

Author Commit Date CI Message
a89db768 2026-01-05 14:46:59 handle Meta release as a separate mod key. from Sven M. Hallberg
9be0e4bd 2020-03-24 14:47:29 Instead of using _NET_ACTIVE_WINDOW on restart, use the pointer location to determine what client to set active. Reduces a round trip for every window.
caa934d8 2020-02-27 14:56:39 Unrelated style fixes, consistency changes and sorting, appropriate dosage/removal of wrappers, simplification of name queue, client cycle joins other kb/mb bound functions.
36336514 2020-02-03 16:38:02 Map ('5') and allow mod5mask (altgr) as a modifier. From Artturi Alm (though changed from 'm' to '5')
20bce2a6 2019-04-29 19:02:21 Handle _NET_WM_NAME changes. This fixes the problem where cwm's window menu wouldn't show Firefox's current window title if it contains non-ASCII characters. OK okan@
48e6bf1e 2019-03-11 15:25:46 Check the atom type on propertynotify before iterating.
c8b9937b 2019-03-10 22:53:11 use screen_find() for xrandr crtc changes
b041ee60 2019-03-10 20:38:28 Find the managed screen from the parent window for client_current().
1dc13f57 2019-03-08 17:40:43 Similar to keypress event, fetch the screen from the event root window in the buttonpress handler; bail if we don't manage the screen. Allows us to find the current client based on the screen/event root.
e34b5f47 2019-03-08 15:04:39 extend verbose logging for key/button events
d039ccc7 2019-03-08 14:48:02 [keypress event] turns out we've been checking the wrong window for a matching client thus always falling back to client_current(); while the current client is problaby right in most cases, use event's subwindow (not window) to find the client. Bail early if this event came to us from a screen we don't manage. This is result of us grabing all keybindings off the root window instead of selectively.
adfbd356 2019-03-08 13:17:26 add parans for readibility
4957b62d 2019-03-07 14:28:17 Teach client_current() to use a screen to find the current client instead of iterating over all (fallback if no screen provided for now). Initially convert trivial uses of client_current().
af768514 2019-03-06 13:32:19 same thing as screen_find()
ef3d45ea 2019-02-28 23:26:12 Move the group index (desktop number) check to the only 2 callers that require checking due to ewmh.
90189b3c 2019-02-22 19:40:32 Rename internal functions to delinate between client remove, delete and xproto delete; 'window-close' is now the proper action, but 'window-delete' as an alias will remain until more interesting changes require breaking configs.
ee0ce74a 2018-11-13 17:37:13 Allow 'transientfor' clients to inherit group and bwidth either during init or via property notify events. Previously only the flags were set but nothing was in the path to apply said flags and/or bwidth. Required slight of re-orgnaization of client_init.
5e4538db 2018-02-04 22:56:26 Slightly expand and expose verbose debugging.
b5c7b4db 2018-02-02 13:50:22 add debugging for x events
73d42251 2017-12-29 18:50:43 As done for buttonrelease, work specific un-cycling and un-highlighting actions into the keyrelease event, only performing what's actually needed for each; should result in much fewer events against keyreleases. No intended behaviour change. Additionally, like we do for group membership, grab the keyboard only when required for cycling.
ef788522 2017-12-29 16:55:50 Merge group_toggle_membership_leave into the buttonrelease event and only do border work for a group/ungroup action.
832edccd 2017-12-29 12:54:54 add helper function client_show to bring together like actions for unhide/raise
bcdf71d0 2017-12-27 17:04:35 Use poll and XNextEvent to replace XNextEvent blocking inside the x11 event handler.
942a9a42 2017-05-09 18:43:40 drop obsolete comment
ba98b33f 2017-05-09 13:40:18 Alter callbacks to take a struct instead of a growing number of arguments; greatly simplifies upcoming work.
4811ec04 2016-10-18 17:03:30 Refactor callbacks to take a void * so as to not try and generalize into client_ctx in keypress and buttonpress event handlers; pass appropriate *ctx's based on context. While here, limit some globals, replace defines with appropriate variables and fix some naming.
a53fef7b 2016-10-06 14:41:19 Add an argument to the callbacks to pass the xevent context, button or key press. This allows to remove a few hacks to duplicate functions only for behaviour changes; now differing behaviours are pushed down to the callback. Also will allow for previously unavailable actions to be bind-able down the road.
c42b7d0a 2016-10-04 20:15:55 When removing xrandr regions, ensure clients are within the bounds of the screen; adapted from an ancient diff from Sviatoslav Chagaev. Things in this area will likely change, but put this in so it works now and serves as a reminder.
3881d6ad 2016-10-03 13:41:30 client_ptrwarp should not deal with unhiding or raising clients (non ptr requests); most callers do this already - deal with the few that do not. client_ptrwarp becomes a simple wrapper (setpos) but it will be expanded.
9b943acf 2016-09-16 14:32:02 During init, query screen for _NET_ACTIVE_WINDOW and set that client as active; while we already look at what's under the pointer, use this information first, then look under the pointer (saving that round-trip). This restores the active state to a client after restart even if the pointer is not above it (and of course the pointer is not above another client).
b0ab7f2e 2016-09-14 19:45:33 Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flag instead of relying on curcc.
0abb5fd0 2015-11-10 20:05:33 Start cleaning up name vs function differences; replace magic numbers.
72c4ff32 2015-08-27 18:42:56 Add consistent checks against NULL.
56fb99c7 2015-07-01 14:36:42 style
eb3dae29 2015-06-30 14:01:43 Re-implement XClientMessage handling so that we can feed screen_find and client_find valid resources as needed, relieving the need for screen_find to ungracefully handle invalid root windows. Removes a long standing XXX. Should theoretically allow XClientMessage handling on more than one X screen. Alter callers of screen_find to handle failures.
c199720b 2015-01-19 14:54:16 Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAX and HOST_NAME_MAX+1, respectively. ok doug@
c9178afc 2014-09-27 19:04:32 these have nothing to do with 'sticky', but rather group membership; rename.
50da66bd 2014-09-15 13:00:49 use similiar style for client flags
ae092d42 2014-09-07 17:38:38 screen_fromroot -> screen_find
4abab668 2014-09-06 16:08:58 Rework group names: stash the group name inside the group_ctx as opposed to having to manage an array outside in screen_ctx for group names and shortcuts. Simplifies (and moves bits for) reading, and constructing data for, EWMH's _NET_DESKTOP_NAMES.
ea2abae9 2014-02-03 20:20:39 Move redundant bits from screen_init (while dealing with existing clients) directly into client_init, performing the X roundtrip only once. With the previous change in maprequest, this moves decision making into one place for creating new clients.
bb4485df 2014-02-02 21:34:05 Move redundant window attr fetch from maprequest directly into client_init and perform that X roundtrip only once.
9f5aa96c 2014-01-30 15:41:11 Move cwm_status around to avoid header fu, and remove extraneous signal header from xevents.c; noticed by Christian Neukirchen.
78ff1f74 2014-01-29 21:13:52 Merge keybinding and mousebinding queues into using the same merged struct, binding; they were essentially the same accept for what was 'pressed', keysym or button.
2d6c7c78 2014-01-28 13:40:40 The EWMH spec states that if the cardinal returned is 0xFFFFFFFF (-1) then the window should appear on all desktops, which in our case is assigned to group 0. Found to fix stalonetray due to the non-ewmh aware range checking in group_movetogroup(); from Thomas Adam.
3b8ad25f 2014-01-22 21:48:27 Somewhat streamline event loop/restart/quit handling; most notable change allows a restart to trigger proper teardown first, even though teardown is not (yet) complete. After some discussion with oga@nicotinebsd.org regarding a more complicated version/idea.
57bbf0fd 2014-01-20 23:03:51 merge KBFLAG_NEEDCLIENT and MOUSEBIND_CTX_*; brings kbfunc and mousefunc bits even closer.
72ccee09 2014-01-03 15:29:06 use consistent types
c0d34338 2014-01-02 22:43:55 Accept _NET_CURRENT_DESKTOP ClientMessage; from Thomas Adam, though instead of group toggle, group only.
37b3ff69 2014-01-02 22:26:27 Accept _NET_WM_DESKTOP clientmessage; from Thomas Adam
24e4f6a4 2014-01-02 21:30:20 bring mousefunc closer to kbfunc
c11a490e 2013-12-13 14:45:47 stray space and sort while here
1d68a42e 2013-12-13 14:40:52 Add support for XUrgency and matching _NET_WM_STATE_DEMANDS_ATTENTION ewmh hint; urgencyborder is configurable. The urgency flag will stick, even while on a client in a non-viewable group, until the client receives focus (where the border is reset). Initial diff from Thomas Adam with some changes/enhancements from me.
e5da7748 2013-12-12 20:15:07 ICCCM explicitly states that server time (CurrentTime) should *not* be used for focus events, but rather the timestamp of the generated event. Track the last event timestamp and send it down for a WM_TAKE_FOCUS ClientMessage. I suspect we should do this for clients that don't announce this Atom as well, though the raciness gets us into a bind. Solves focus order issue since WM_TAKE_FOCUS; fix verified by sthen@ ok sthen@
3d5c1094 2013-12-11 15:41:11 Add client wrapper for XWMHints to support XA_WM_HINTS in PropertyNotify events; based off a diff from Thomas Adam.
5da88fd6 2013-12-11 14:16:09 Remove extra work and simplify client state handling.
3207d6dc 2013-12-02 14:30:12 Since we use IconicState as our hidden state, check for the hidden flag and unmanage the client if we're not hidden (basically if NormalState) during an UnmapNotify event. Resolves an issue with mplayer going fullscreen while not using NetWM hints; behaviour regression reported by Ido Admon.
9b29ffac 2013-11-27 16:24:17 Remove the option to bind a key by keycode with brackets; it never worked (and no one complained!). While it's fairly easy to fix, users should be using keysym names and not keycodes. Discussed at length months ago with todd@, matthieu@ and Owain.
57ba45de 2013-11-27 00:01:23 Rewrite active/inactive client handling in client_setactive(); client_leave() served no real purpose, likewise no reason to handle LeaveNotify events since an EnterNotify will process the next active client (and we don't have anything important to process anyway), so xev_handle_leavenotify() goes as well. Allows a simplification of client_mtf() and client_cycle_leave() for clarity. While here, unify a few client_current() checks. No intended behaviour change.
632f11c5 2013-11-12 21:25:00 Alter the r1.35 of event.c race fix. Remove the forward looking event queue check (removing the need for a server grab/ungrab) - if the client is going away, let it fall all the way through to a DestroyNotify event. There's no longer a need for us to manually destroy a client ourselves (removing yet another server grab/ungrab). Instead, when the UnmapNotify event is synthetic, simply set the state to Withdrawn (as per ICCCM), else Iconic (in our case 'hidden'). Verified with test case from the 2009 race which was the original reason for r1.35 of event.c.
a8efa775 2013-10-25 19:46:16 A client_delete should behave differently depending on whether the triggering event was unmap (with pending destroy) log destroy; we only need to grab/ungrab the server lock, set WithdrawnState and XRemoveFromSaveSet clients coming from an unmap event - doing so for clients coming from destroy are already gone, hence we generate errors.
76b17dcb 2013-07-15 23:51:59 collapse lines
1ca1aa39 2013-07-15 14:50:44 simplify atom handling; allows us to limit to one round-trip to server for gathering Atoms.
407cedca 2013-07-10 14:15:58 bring buttonpress and keypress event handlers slightly closer together
ad88124f 2013-07-08 18:19:22 move kbfunc and mousefunc closer together
2993105e 2013-07-08 15:46:16 whitespace and style fixes; from Tiago Cunha and one from me.
356be89e 2013-06-10 21:37:30 move synthetic responses and have client_msg only work with WM_PROTOCOLS, since that's all ClientMessageEvent is for anyway.
5daab9b2 2013-06-10 20:11:43 Check for, and honour, CWStackMode and CWSibling change requests during a ConfigureRequest event. Additionally, honour a border width change; detailed report and patch from Mike Small.
4c523911 2013-05-23 16:52:39 alter conf_grab(_kbd) to first ungrab AnyKey/AnyModifier, then proceed to grab keys in keybindingq. we don't need to ungrab/grab on every addition to the queue, just once with a complete keybindingq; simplify grabbing keys per screen (during init) and during a MappingNotify. while here, change conf_grab_{kbd,mouse} to require only a Window.
d66a0bde 2013-05-21 00:29:20 handle _NET_WM_STATE ClientMessage; from Alexander Polakov.
1e33cdcb 2013-05-20 21:32:00 stray whitespace
d8afbe1a 2013-05-20 21:19:15 handle _NET_ACTIVE_WINDOW ClientMessage; from Alexander Polakov.
1f7de62e 2013-05-19 17:05:52 add support for _NET_CLOSE_WINDOW
e8ab9bac 2013-05-19 17:03:55 treat WM_CHANGE_STATE like other atoms
54d74a2e 2013-05-19 17:01:29 simplify
7ab14695 2013-05-11 22:01:07 new -> init
dc5b3b52 2013-05-10 16:32:47 more type fixes for mask/button
8044f370 2013-05-10 16:05:34 int type fixes
f0fe071b 2013-05-10 15:44:43 fix KeySym type
87e16df1 2013-04-29 00:56:47 use an int in screen_init and avoid needing to cast for screen number (which).
13a11c87 2013-04-05 17:07:25 zap stray whitespace
7f6aabcb 2012-12-18 17:37:39 define LockMask|Mod2Mask; no functional change
4f78cb68 2012-11-09 03:52:02 sort
4f79744f 2012-11-07 14:49:46 missing headers; from Thordur Bjornsson.
762473fe 2012-09-12 15:09:33 revert previous for now until a way to test more than a few encodings is found
2a98b1a0 2012-09-10 13:28:04 be explicit in which key masks we allow during keypress and buttonpress events; from Alexander Polakov - makes non-us layout reliable.
94b92cf7 2012-07-13 17:01:04 re-use geom struct in client_ctx (saved)geometry.
6ee7c653 2012-07-13 15:21:35 convert xmax/ymax uses to view geometry.
37bdf57a 2012-07-06 14:18:00 querying for Xinerama should be done per display, not per screen, so move chuck to display init; allows some shuffling to occur limiting screen_init_xinerama()'s scope while keeping order intact.
43b628a3 2012-07-05 17:35:13 the display's width and height are updated after an XRandR event so we don't need to pass down the new values to screen_update_geometry(); so just read the width/height values directly for both uses of screen_update_geometry(). prep for further changes in this area.
d24974f4 2012-07-03 13:49:03 re-implement atom handing; makes for a normalized and more consistent separation between cwm and ewmh. seen by a few.
50687e78 2012-05-16 21:57:21 get rid of more stray lines/spaces
adfd269d 2012-05-16 01:09:17 cycle through other common cycling modifiers; based on a diff from Alexander Polakov. ok sthen@
abc316c1 2012-05-16 01:04:36 convert from deprecated XKeycodeToKeysym to XkbKeycodeToKeysym ok sthen@
87d3c252 2012-05-13 15:17:13 altpersist->cycling to be more clear that this is for cycling mod persistence; based on a diff from Alexander Polakov, in preparation for looping through other potential cycling modifiers.
5d6aec2d 2011-09-13 08:41:57 add WM_TRANSIENT_FOR event support: moves dialogs, toolbars and such to the group of the main application window; based on a diff from Alexander Polakov with CLIENT_IGNORE flag suggestion from oga@. ok oga@
af80ac70 2011-08-22 16:34:34 A while ago I wrote some code to not warp to ignored windows on map (rev 1.52), not realising that the previous (less efficient) fix had already been commited (rev 1.50). Had this in my tree for ages to remove the previous code. Effectively reverts rev 1.50. ok okan@
cfdfe3cd 2011-06-24 05:33:41 Correct extern declaration and while here, rename a variable to be pedantic. from Thomas Pfaff. ok oga@
4fb00eca 2011-05-11 13:53:51 tag and comment cleanup; ok oga@
a1517de6 2011-05-06 19:39:44 On map, don't warp to windows that are marked as ignored. Requested by Christian Neukirchen last august. He provided a patch but the one I wrote was significantly simpler (1 - 2 + in the whole diff). makes sense to okan@.