Commit Graph

187 Commits

Author SHA1 Message Date
okan
e9dbd150ea these have nothing to do with 'sticky', but rather group membership; rename. 2014-09-27 19:04:32 +00:00
okan
8fd0f43ec2 these client actions are just toggles; less confusing with better names 2014-09-17 18:41:44 +00:00
okan
458dd31b93 ewmh states _NET_WM_STATE_STICKY should not alter position 2014-09-17 18:09:30 +00:00
okan
7eef4eb63d don't toggle _WM_STATE_HIDDEN here yet 2014-09-17 16:30:21 +00:00
okan
a61812d52d Implement EWMH _NET_WM_STATE_HIDDEN. 2014-09-17 16:00:44 +00:00
okan
4b6dc96398 use similiar style for client flags 2014-09-15 13:00:49 +00:00
okan
d27fc99784 fold in 'active' into 'flags' 2014-09-10 20:30:38 +00:00
okan
20c1113fdd move the check for an empty queue up during cycle 2014-09-08 21:24:27 +00:00
okan
aac16013d2 name the group client queue appropriately, like other queues 2014-09-08 21:15:14 +00:00
okan
b64ce8558c more style nits and wrapping 2014-09-08 20:37:02 +00:00
okan
bc70374264 since mruq has been folded in, rename mru-named functions 2014-09-08 20:32:40 +00:00
okan
26ba152692 Remove duplicate client queue (mruq); instead, remove and take the
global Clientq and place it inside screen_ctx since every client belongs
to a screen, then use the same per screen clientq to track stacking
order (the sole reason for mruq).
2014-09-08 20:11:22 +00:00
okan
3d12b6d1d9 more style nits 2014-09-07 19:27:30 +00:00
okan
be091b3523 screen_fromroot -> screen_find 2014-09-07 17:38:38 +00:00
okan
7314a3aefd Implement _NET_WM_STATE_STICKY, bound to CM-s by default; allows any
client to 'stick' to all desktops (ewmh speak) or groups - this
currently has the same affect as setting a client's group to 'nogroup',
with the exception that the client can also be in a group, so when
un-sticking, the client will go back to its original group/desktop.
2014-08-25 12:49:19 +00:00
okan
b31b09dfc2 Purely mechanical; unify 'num', 'no' and 'shortcut'. 2014-08-20 15:15:29 +00:00
okan
98d8483d35 Some clients set the urgency flag even if they are the active client;
prevent annoying behavior by only setting the cwm urgency flag if the client
is not active; diff from Thomas Adam.
2014-02-06 20:58:46 +00:00
okan
ad96c16838 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
ad76995af7 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
0608610cc7 move some init up and shed some blank lines 2014-01-27 15:13:09 +00:00
okan
08342471c8 state is long 2014-01-03 14:23:50 +00:00
okan
8420398068 rename for clarity 2014-01-02 21:15:39 +00:00
okan
46b1d6ef1e When a client doesn't specify size hints, nothing prevents a resize to
0x0 - don't allow this situation during mouse resize (check already in
place for kbd resize).

Reported by brynet@
2014-01-02 20:58:20 +00:00
okan
da2bea3ffa replace with memset 2013-12-17 16:10:43 +00:00
okan
19fc7f666b Implement support for EWMH's _NET_WM_STATE_FULLSCREEN hint.
Since we already have a form of 'maximize', we need to differentiate
between 'maximize' and the new 'fullscreen' mode.  The 'maximize' mode
will continue to honor gap but now *retains* the border, matching the
'vert/horz maximize' behaviour.  The new 'fullscreen' mode supports and
follows the _NET_WM_STATE_FULLSCREEN hint, allowing the client perform
additional window modifications; in this mode, cwm(1) will *ignore* gap,
remove borders and freeze(move/resize) the client.  Additionally,
'fullscreen' mode will remember various combinations of previous states.

* default keybinding changes: CM-f 'fullscreen', CM-m 'maximize' (re-map
  as desired).

Positive feedback from a few, testing and ok sthen@
2013-12-16 19:02:17 +00:00
okan
f98f4615c0 Teach screen_find_xinerama() to apply gap only when told to do so;
adjust callers.  Needed for an upcoming feature.
2013-12-13 22:39:13 +00:00
okan
91a29396e8 we need the save-set when re-exec'ing so as to not lose State on our hidden clients 2013-12-13 15:56:44 +00:00
okan
b276a2ef00 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
e767ac9c65 we don't need to manage the save-set since we're not reparenting; left-over from pwin 2013-12-11 22:14:23 +00:00
okan
09e07ddaaf since we are drawing in unhide, no need to during client setup 2013-12-11 17:23:31 +00:00
okan
68f365cddb apply mwm hints later 2013-12-11 15:46:47 +00:00
okan
7e0749b0b1 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
0d9b1becff Remove extra work and simplify client state handling. 2013-12-11 14:16:09 +00:00
okan
23a1abdd8a Stash Class and WM Hints in client_ctx 2013-12-11 14:09:21 +00:00
okan
1d68f0683a Redraw client border when unhiding; during a hide, we just unset
the active flag but never redraw since it'll be in IconicState.

Behaviour reported by sthen@
2013-12-10 21:27:37 +00:00
okan
1b6ef8e9ed alter -r1.145 getsizehints to deal with clients that don't have
WM_NORMAL_HINTS.
2013-11-27 17:04:35 +00:00
okan
250f98bf15 simplify/unfold 2013-11-27 14:20:32 +00:00
okan
fa25915a75 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
2937b2066f 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
bda68b0924 Put back the border draw call in client_resize; since we are adding and
removing the border on maximized clients we need to redraw.

Also noticed by Tim van der Molen
2013-11-11 12:51:15 +00:00
okan
3bb928a1c2 stash WMProtocols in flags 2013-11-08 17:35:12 +00:00
okan
c1bc6d37b3 quick keyboard focus fix for clients that neither populate wmhints nor wmprotocols, like rdesktop; focus needs to be re-visited 2013-11-05 00:55:42 +00:00
okan
b5915eb989 The only reason we need to keep XSizeHints in our client_ctx is for
flags, so just add one to hints; consolidates sizehints and shrinks.
Additionally don't abuse PSize for XGetWMNormalHints() failures.
2013-11-02 19:13:56 +00:00
okan
b8f53666bd x/y from XSizeHints are obsolete (and have been for a long time), so
instead use x/y from XWindowAttributes when USPosition|PPosition are
set.
2013-11-01 21:54:20 +00:00
okan
06eb13dfd9 re-add support for WM_TAKE_FOCUS, and additionally this time only call
XSetInputFocus() for clients that have the InputHint; latter fix
discovered by Valery Masiutsin with a PoC patch - solves keyboard input
focus loss for java apps.
2013-11-01 14:07:19 +00:00
okan
6e17b41f56 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
9ff288baef revert 1.138 (WM_TAKE_FOCUS) for now 2013-10-20 01:35:47 +00:00
okan
a2013ee9dd Using xu_btn_ungrab() buttons during client_leave doesn't work (error
BadValue) when the modifier is already AnyModifier .  Instead alter
xu_btn_ungrab() to ungrab AnyButton/AnyModifier and call it only when a
client is coming into focus in client_setactive(), instead of iterating
over ignore mods - matches how we handle key grabs.
2013-10-19 19:39:34 +00:00
okan
083a023f2c I believe we redraw the border in too many cases; likely a leftover from
the cc->pwin days - don't redraw on every unhide, resize, and mouse
move/resize Expose event (note, all Expose events trigger a redraw
anyway).

Tested with some finicky X apps I could think of, though I'm sure others
will find more - if so, and they 'lose' the border, please report!
2013-10-19 18:59:22 +00:00
okan
a70b2d81af For clients that support WM_TAKE_FOCUS in their WM_PROTOCOLS property, send
a ClientMessage event.
2013-10-19 00:24:54 +00:00