Commit Graph

129 Commits

Author SHA1 Message Date
okan
dcdbf54e85 For both kb and mouse move, it is possible to grab a client and move it
completely off the screen/region; instead, if the pointer is outside of
the client bounds, warp the pointer to the closest edge before moving.
2016-10-03 13:52:17 +00:00
okan
3881d6ad85 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.
2016-10-03 13:41:30 +00:00
okan
374d386034 Continue merging kb and mouse functions: fold
mousefunc_menu_{client,cmd,group} into the respective
kbfunc_menu_{client,cmd,group} functions; simply pass a flag down from
config denoting mouse action behaviour.
2016-09-22 14:36:03 +00:00
okan
448a04ca44 If a client does not set increment values, use 'moveamount' as a way to
scale keyboard based resizes; extend kbfunc_amount().

Behaviour noted by, tested by, and ok sthen@
2015-11-17 14:32:38 +00:00
okan
403542f5b2 more client vs screen context differences 2015-11-12 21:28:03 +00:00
okan
6e55f9d89b If a client sets hints, honor them for kb resize requests, just like we
do for mouse based resize requests.

Based on a patch from Vadim Vygonets.
2015-11-12 18:33:30 +00:00
okan
db0907a53d Move kb pointer movement out of the kbfunc_client_moveresize since it's
got nothing to do with clients, thus doing flags work causes lots of
waste and almost useless jumpy pointer movements; while here, split out
move and resize since they share almost no code, just like mouse client
move/resize; factor out amount and factor. Still wonder why this is
here, but it works now.
2015-11-12 18:26:41 +00:00
okan
a7bbf5197e Partial revert of replacing screen_area() with region_find(); until a
fix for a regression is found; this bug has been around for a long time
it seems, but this change exposed it. Likely need to track clients in to
and out of regions.
2015-11-11 14:22:01 +00:00
okan
72507096a1 Use position on root to figure out region. 2015-11-10 22:06:57 +00:00
okan
0abb5fd0f1 Start cleaning up name vs function differences; replace magic numbers. 2015-11-10 20:05:33 +00:00
okan
ffc7945b8d Extend region to include both view and work areas; switch to
region_find() which no longer needs to recalculate gap each time
a client (or menu) is created or altered. If no RandR, fall back
to display dimensions while building regions instead of during
execution.
2015-11-09 20:03:29 +00:00
okan
c10cac3b1e On execwm, we should properly release resources before exec'ing into a
new window manager; so allow CWM_EXEC_WM to assign new wm to wm_argv and
pass through cwm_status (now EXECWM) so that x_teardown() gets called
before exec'ing the new window manager.  Removes the need for a separate
x_restart() now, using new wm_argv; and consolidates errno for execvp.
2015-09-16 17:58:25 +00:00
okan
ae8386de40 Lost fix from r1.112; add comment.
Reported (again!) by Peter Kane.
2015-08-28 12:07:28 +00:00
okan
db9c5cf159 Move client cycle grab/ungrab into a more relevant place; while here,
update comments about why we need to grab/ungrab the keyboard.
2015-08-27 18:40:09 +00:00
okan
d01e312b01 _NET_WM_STATE_STICKY implies only sticky at the group/desktop level, not
position and size; based on discussion with a few.
2015-08-21 16:14:39 +00:00
okan
8809c816d0 Instead of special casing the 'term' and 'lock' commands, go back to
keeping them hidden; showing them has apparently caused confusion/angst.
2015-08-21 16:05:55 +00:00
okan
8529d9a1c6 introduce 'groupsearch' for group menu search; matches on either group
number/shortcut and/or name.
2015-07-12 14:31:47 +00:00
okan
0cbfba6ca3 revert previous; seems search_match_text() needs mi->text pre-populated.
(only used in one place, application menu searching); re-visit later.

broken application menu searching reported by Peter Kane.
2015-07-03 17:11:16 +00:00
okan
cfb0bdf8f5 no longer need to pass down format strings after introducing search_print_cmd 2015-06-30 19:02:24 +00:00
okan
6e095b76d0 Introduce a callback for cmd menu printing, special-casing 'lock' and
'term'.
2015-06-30 18:54:12 +00:00
okan
89eefd254e Shuffle code in kbfunc_ssh so that a missing known_hosts file still
allows a (now blank) menu to appear, as opposed to nothing at all.

Behavior reported by Alex Greif.
2015-06-29 14:24:40 +00:00
okan
933ce723de Mechanical change from xinerama to region backed areas. 2015-06-26 17:17:46 +00:00
okan
c049f12cd4 just populating the ctx is enough since the menu uses a callback and ignores anything else 2015-06-08 15:43:13 +00:00
okan
d6e84c8298 merge kbd and mouse grouptoggle 2015-05-21 00:37:04 +00:00
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
1d2cb82cf4 these client actions are just toggles; less confusing with better names 2014-09-17 18:41:44 +00:00
okan
9daa5fe3e6 ewmh states _NET_WM_STATE_STICKY should not alter position 2014-09-17 18:09:30 +00:00
okan
264064d617 Remove incorrect cast in kbfunc_exec. In kbfunc_ssh, reverse logic on
truncation check so it's obvious.
2014-09-11 16:06:26 +00:00
okan
0fefd96f3e 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
ea3574d110 Few style nits; extend 'path' to MAXPATHLEN. 2014-09-06 18:50:43 +00:00
okan
70027868ed Move termpath and lockpath into cmdq; side effect is that 'lock' and
'term' now show up in the application menu.
2014-09-06 16:14:35 +00:00
okan
1150bfd22b add explicit paran and drop some empty lines bringing like functions closer 2014-09-01 18:17:32 +00:00
okan
749976d1d7 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
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
d5979e3ab6 Minimize trivial differences between a few kb and mb functions. 2014-01-29 22:30:00 +00:00
okan
40c619037f If no title is supplied, term uses only the basename for its title.
This is useless when searching for windows launched via the ssh command
menu; supply a more useful title: '[ssh] <hostname>'.

Idea from todd@, ok todd@
2014-01-23 16:51:28 +00:00
okan
b740a0a91a zap whitespace 2014-01-22 22:41:09 +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
b92e846e56 Sprinkle a few more const; from Tiago Cunha. 2014-01-21 15:42:44 +00:00
okan
69bb069674 Save the ptr position before lowering via kbd, so as to be able to cycle
back with the pointer in the right place; matches behaviour when
lowering via the mouse function.
2014-01-20 23:18:47 +00:00
okan
9a540a7adb constify and rename some confusing variables around cmdq. 2014-01-20 21:34:32 +00:00
okan
83b0cbf116 Add a function that adds an entry to a menuq, normalizing a common code
path; from Tiago Cunha.
2014-01-20 18:58:03 +00:00
okan
72ccee09ff use consistent types 2014-01-03 15:29:06 +00:00
okan
468c12c5da 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
4104232e02 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
5671dd5497 Instead of using work area, use the Xinerama area for snap calculations;
based on a patch from Thomas Adam with appropriate adjustments for gap.
2013-12-13 21:51:56 +00:00
okan
baac27374e Make sure we really take work area gap into account with snap calculations;
from Dominik Honnef via Christian Neukirchen.
2013-12-12 21:50:50 +00:00
okan
a287dfc793 like gap, make snapdist per screen 2013-11-27 18:34:34 +00:00
okan
0710bf7edc a few err->errx since we don't have error messages here; from Tiago Cunha 2013-10-17 13:59:10 +00:00