Commit Graph

116 Commits

Author SHA1 Message Date
okan
c199720bcc Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAX
and HOST_NAME_MAX+1, respectively.

ok doug@
2015-01-19 14:54:16 +00:00
okan
c9178afc38 these have nothing to do with 'sticky', but rather group membership; rename. 2014-09-27 19:04:32 +00:00
okan
50da66bd50 use similiar style for client flags 2014-09-15 13:00:49 +00:00
okan
ae092d4229 screen_fromroot -> screen_find 2014-09-07 17:38:38 +00:00
okan
4abab66820 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.
2014-09-06 16:08:58 +00:00
okan
ea2abae9f3 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.
2014-02-03 20:20:39 +00:00
okan
bb4485df6b Move redundant window attr fetch from maprequest directly into
client_init and perform that X roundtrip only once.
2014-02-02 21:34:05 +00:00
okan
9f5aa96cc7 Move cwm_status around to avoid header fu, and remove extraneous signal
header from xevents.c; noticed by Christian Neukirchen.
2014-01-30 15:41:11 +00:00
okan
78ff1f748c 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.
2014-01-29 21:13:52 +00:00
okan
2d6c7c78d8 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.
2014-01-28 13:40:40 +00:00
okan
3b8ad25f38 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.
2014-01-22 21:48:27 +00:00
okan
57bbf0fd90 merge KBFLAG_NEEDCLIENT and MOUSEBIND_CTX_*; brings kbfunc and mousefunc
bits even closer.
2014-01-20 23:03:51 +00:00
okan
72ccee09ff use consistent types 2014-01-03 15:29:06 +00:00
okan
c0d34338d1 Accept _NET_CURRENT_DESKTOP ClientMessage; from Thomas Adam, though
instead of group toggle, group only.
2014-01-02 22:43:55 +00:00
okan
37b3ff69f9 Accept _NET_WM_DESKTOP clientmessage; from Thomas Adam 2014-01-02 22:26:27 +00:00
okan
24e4f6a4b6 bring mousefunc closer to kbfunc 2014-01-02 21:30:20 +00:00
okan
c11a490e80 stray space and sort while here 2013-12-13 14:45:47 +00:00
okan
1d68a42ec0 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.
2013-12-13 14:40:52 +00:00
okan
e5da774880 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@
2013-12-12 20:15:07 +00:00
okan
3d5c10942f Add client wrapper for XWMHints to support XA_WM_HINTS in PropertyNotify
events; based off a diff from Thomas Adam.
2013-12-11 15:41:11 +00:00
okan
5da88fd68f Remove extra work and simplify client state handling. 2013-12-11 14:16:09 +00:00
okan
3207d6dcc9 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.
2013-12-02 14:30:12 +00:00
okan
9b29ffac8c 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.
2013-11-27 16:24:17 +00:00
okan
57ba45de2c 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.
2013-11-27 00:01:23 +00:00
okan
632f11c555 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.
2013-11-12 21:25:00 +00:00
okan
a8efa775ea 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.
2013-10-25 19:46:16 +00:00
okan
76b17dcb11 collapse lines 2013-07-15 23:51:59 +00:00
okan
1ca1aa39ab simplify atom handling; allows us to limit to one round-trip to server
for gathering Atoms.
2013-07-15 14:50:44 +00:00
okan
407cedcacc bring buttonpress and keypress event handlers slightly closer together 2013-07-10 14:15:58 +00:00
okan
ad88124f83 move kbfunc and mousefunc closer together 2013-07-08 18:19:22 +00:00
okan
2993105e89 whitespace and style fixes; from Tiago Cunha and one from me. 2013-07-08 15:46:16 +00:00
okan
356be89e9f move synthetic responses and have client_msg only work with WM_PROTOCOLS,
since that's all ClientMessageEvent is for anyway.
2013-06-10 21:37:30 +00:00
okan
5daab9b270 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.
2013-06-10 20:11:43 +00:00
okan
4c52391113 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.
2013-05-23 16:52:39 +00:00
okan
d66a0bde40 handle _NET_WM_STATE ClientMessage; from Alexander Polakov. 2013-05-21 00:29:20 +00:00
okan
1e33cdcb18 stray whitespace 2013-05-20 21:32:00 +00:00
okan
d8afbe1a8b handle _NET_ACTIVE_WINDOW ClientMessage; from Alexander Polakov. 2013-05-20 21:19:15 +00:00
okan
1f7de62e0c add support for _NET_CLOSE_WINDOW 2013-05-19 17:05:52 +00:00
okan
e8ab9bac94 treat WM_CHANGE_STATE like other atoms 2013-05-19 17:03:55 +00:00
okan
54d74a2ed2 simplify 2013-05-19 17:01:29 +00:00
okan
7ab1469590 new -> init 2013-05-11 22:01:07 +00:00
okan
dc5b3b52df more type fixes for mask/button 2013-05-10 16:32:47 +00:00
okan
8044f37078 int type fixes 2013-05-10 16:05:34 +00:00
okan
f0fe071b5a fix KeySym type 2013-05-10 15:44:43 +00:00
okan
87e16df157 use an int in screen_init and avoid needing to cast for screen number (which). 2013-04-29 00:56:47 +00:00
okan
13a11c8799 zap stray whitespace 2013-04-05 17:07:25 +00:00
okan
7f6aabcb3d define LockMask|Mod2Mask; no functional change 2012-12-18 17:37:39 +00:00
okan
4f78cb6835 sort 2012-11-09 03:52:02 +00:00
okan
4f79744f37 missing headers; from Thordur Bjornsson. 2012-11-07 14:49:46 +00:00
okan
762473fe35 revert previous for now until a way to test more than a few encodings is found 2012-09-12 15:09:33 +00:00