summary refs log tree commit diff
path: root/xevents.c
Commit message (Collapse)AuthorAgeFilesLines
* extend verbose logging for key/button eventsokan2019-03-081-4/+7
|
* [keypress event] turns out we've been checking the wrong window for a matchingokan2019-03-081-6/+7
| | | | | | | | 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.
* add parans for readibilityokan2019-03-081-4/+4
|
* Teach client_current() to use a screen to find the current client instead ofokan2019-03-071-5/+5
| | | | | iterating over all (fallback if no screen provided for now). Initially convert trivial uses of client_current().
* same thing as screen_find()okan2019-03-061-7/+3
|
* Move the group index (desktop number) check to the only 2 callers that requireokan2019-02-281-2/+6
| | | | checking due to ewmh.
* Rename internal functions to delinate between client remove, delete and xprotookan2019-02-221-3/+3
| | | | | delete; 'window-close' is now the proper action, but 'window-delete' as an alias will remain until more interesting changes require breaking configs.
* Allow 'transientfor' clients to inherit group and bwidth either during init orokan2018-11-131-0/+3
| | | | | | 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.
* Slightly expand and expose verbose debugging.okan2018-02-041-14/+14
|
* add debugging for x eventsokan2018-02-021-0/+28
|
* As done for buttonrelease, work specific un-cycling and un-highlighting actionsokan2017-12-291-1/+12
| | | | | | | | | 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.
* Merge group_toggle_membership_leave into the buttonrelease event and only dookan2017-12-291-2/+4
| | | | border work for a group/ungroup action.
* add helper function client_show to bring together like actions for unhide/raiseokan2017-12-291-4/+1
|
* Use poll and XNextEvent to replace XNextEvent blocking inside the x11 eventokan2017-12-271-5/+7
| | | | handler.
* drop obsolete commentokan2017-05-091-1/+0
|
* Alter callbacks to take a struct instead of a growing number of arguments;okan2017-05-091-6/+8
| | | | greatly simplifies upcoming work.
* Refactor callbacks to take a void * so as to not try and generalize intookan2016-10-181-19/+31
| | | | | | | | 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.
* Add an argument to the callbacks to pass the xevent context, button orokan2016-10-061-2/+2
| | | | | | | 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.
* When removing xrandr regions, ensure clients are within the bounds ofokan2016-10-041-0/+1
| | | | | | 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.
* client_ptrwarp should not deal with unhiding or raising clients (non ptrokan2016-10-031-0/+4
| | | | | 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.
* During init, query screen for _NET_ACTIVE_WINDOW and set that client asokan2016-09-161-1/+1
| | | | | | | | 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).
* Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flagokan2016-09-141-3/+6
| | | | instead of relying on curcc.
* Start cleaning up name vs function differences; replace magic numbers.okan2015-11-101-2/+2
|
* Add consistent checks against NULL.okan2015-08-271-3/+3
|
* styleokan2015-07-011-1/+1
|
* Re-implement XClientMessage handling so that we can feed screen_find andokan2015-06-301-38/+42
| | | | | | | | 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.
* Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAXokan2015-01-191-1/+2
| | | | | | and HOST_NAME_MAX+1, respectively. ok doug@
* these have nothing to do with 'sticky', but rather group membership; rename.okan2014-09-271-1/+1
|
* use similiar style for client flagsokan2014-09-151-1/+1
|
* screen_fromroot -> screen_findokan2014-09-071-4/+4
|
* Rework group names: stash the group name inside the group_ctx as opposedokan2014-09-061-1/+1
| | | | | | 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.
* Move redundant bits from screen_init (while dealing with existingokan2014-02-031-1/+1
| | | | | | 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.
* Move redundant window attr fetch from maprequest directly intookan2014-02-021-6/+3
| | | | client_init and perform that X roundtrip only once.
* Move cwm_status around to avoid header fu, and remove extraneous signalokan2014-01-301-1/+0
| | | | header from xevents.c; noticed by Christian Neukirchen.
* Merge keybinding and mousebinding queues into using the same mergedokan2014-01-291-5/+5
| | | | | struct, binding; they were essentially the same accept for what was 'pressed', keysym or button.
* The EWMH spec states that if the cardinal returned is 0xFFFFFFFF (-1)okan2014-01-281-2/+11
| | | | | | 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.
* Somewhat streamline event loop/restart/quit handling; most notableokan2014-01-221-10/+6
| | | | | | | | 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.
* merge KBFLAG_NEEDCLIENT and MOUSEBIND_CTX_*; brings kbfunc and mousefuncokan2014-01-201-3/+3
| | | | bits even closer.
* use consistent typesokan2014-01-031-2/+2
|
* Accept _NET_CURRENT_DESKTOP ClientMessage; from Thomas Adam, thoughokan2014-01-021-1/+7
| | | | instead of group toggle, group only.
* Accept _NET_WM_DESKTOP clientmessage; from Thomas Adamokan2014-01-021-0/+4
|
* bring mousefunc closer to kbfuncokan2014-01-021-1/+1
|
* stray space and sort while hereokan2013-12-131-4/+4
|
* ICCCM explicitly states that server time (CurrentTime) should *not* beokan2013-12-121-0/+2
| | | | | | | | | | | 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@
* Add client wrapper for XWMHints to support XA_WM_HINTS in PropertyNotifyokan2013-12-111-0/+3
| | | | events; based off a diff from Thomas Adam.
* Remove extra work and simplify client state handling.okan2013-12-111-2/+1
|
* Since we use IconicState as our hidden state, check for the hidden flagokan2013-12-021-2/+4
| | | | | | | | 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.
* Remove the option to bind a key by keycode with brackets; it neverokan2013-11-271-3/+1
| | | | | | | 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.
* Rewrite active/inactive client handling in client_setactive();okan2013-11-271-16/+5
| | | | | | | | | | | 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.
* Alter the r1.35 of event.c race fix. Remove the forward looking eventokan2013-11-121-16/+4
| | | | | | | | | | | | 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.