Commit Graph

122 Commits

Author SHA1 Message Date
Leah Neukirchen
a8527b5661 calmwm: sighdlr: use -1 instead of WAIT_ANY 2017-04-25 22:26:57 +02:00
okan
dcb741d2b1 cvsimport
* refs/heads/master: (34 commits)
  Make it clear these are flags.
  Remove duplicate check that strsubmatch() already does; while here, fix a comment.
  Sprinkle __func__ in appropriate error messages.
  Get rid of 'matchname'; it's too surprising to have the menu change during client search as different potential str matches are cycled through. If there's interest, the only string that doesn't exist in the listing is the window's class - that can be added of course, but it makes the line too long imho.
  clean up search_match_client(); no behaviour change
  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.
  remove another unused proto
  Rename 2 kbfunc to match closer to what they do
  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.
  Check the ptr bounds in the new client during cycling, since not all actions do ptrsave, such as restoring client geometry; adapted from a diff by Vadim Vygonets.
  More accurate to say 'toggle', rather than 'select', for group[n]/nogroup.
  Add CM-a for 'nogroup' (CM-0 stays for now); update manpage to reflect.
  Stash wmname into conf.
  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.
  Calculate client nameqlen in client_setname(), the only place it's needed/used.
  Turn CALMWM_NGROUPS define into variable, ngroups.
  Start simplifying menu code; and in turn, remove a cursor no longer needed.
  Defaults are split between defines and conf_init(); normalize these, as well as give 'sticky' groups its own variable.
  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.
  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-24 20:44:08 +00:00
okan
0bb1be86c6 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.
2016-10-18 17:03:30 +00:00
okan
24d6348e52 no need to unmap menu window again 2016-09-29 00:30:40 +00:00
okan
0e8c706633 Mechanical change: move screen menu bits to their own struct. 2016-09-29 00:21:55 +00:00
Christian Neukirchen
669631e5fa Run pledge only on OpenBSD. 2015-11-16 14:47:21 +01:00
okan
4e51ce57a7 cvsimport
* refs/heads/master:
  more client vs screen context differences
  If a client sets hints, honor them for kb resize requests, just like we do for mouse based resize requests.
  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.
  pledge "stdio rpath proc exec" cwm before main event loop, after init/setup - mostly for menu building.
  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.
  Use position on root to figure out region.
  Start cleaning up name vs function differences; replace magic numbers.
  Clean up unused defines.
  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-12 21:28:03 +00:00
okan
a2c066e447 pledge "stdio rpath proc exec" cwm before main event loop, after
init/setup - mostly for menu building.

ok semarie@ (another cwm user)
2015-11-12 17:56:54 +00:00
okan
e20110f344 Start cleaning up name vs function differences; replace magic numbers. 2015-11-10 20:05:33 +00:00
okan
cd21e16675 cvsimport
* refs/heads/master:
  Only when mapping clients from an initial wm start or restart, query the pointer and if it matches the child window, activate it; new clients will not need to make this roundtrip to the server.
  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-23 14:09:40 +00:00
okan
0fdcf3f3df 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
Christian Neukirchen
742732a1c8 cvsimport 2015-01-22 11:06:01 +01:00
okan
7936b9b2a7 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
2540b3f4fe cvsimport 2014-09-18 13:56:58 +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
Christian Neukirchen
9e560bd745 cvsimport 2014-09-07 15:47:44 +00:00
okan
977992626a generic sighandler 2014-09-06 16:24:32 +00:00
Christian Neukirchen
96af45583a remove TAILQ_END and __dead hacks 2014-02-23 15:49:58 +01:00
okan
b923524a8e cvsimport 2014-02-02 21:34:05 +00:00
okan
ad1b78c6d1 No need to store screen colormap and visual; rather just use the X
macros in the one place they are needed.
2014-02-02 16:29:04 +00:00
okan
c7d4add2f2 cvsimport 2014-02-01 00:25:04 +00:00
okan
8b63ac62c2 Let the config parser continue parsing even after encountering an error;
original idea (with now-outdated patch) from Thomas Adam.  Since we now
report where errors exist, this now makes more sense.  Expand a bit on
config file parsing in the cwm(1).

Discussed with a few, including sthen; ok sthen.
2014-02-01 00:25:04 +00:00
okan
2b233f0548 cvsimport 2014-01-28 20:22:21 +00:00
okan
51b3fbee52 Move conf_init/clear into main - no behaviour change; from Tiago Cunha. 2014-01-28 00:42:20 +00:00
okan
5fd119daea cvsimport 2014-01-24 22:38:02 +00:00
okan
978a5767ec cwm_argv doesn't need to be global any longer 2014-01-22 22:26:05 +00:00
okan
5121ea5e10 start properly releasing X resources during teardown 2014-01-22 22:14:02 +00:00
okan
77aa5ac45b 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
371902b3c9 cvsimport 2014-01-21 15:42:44 +00:00
okan
ac3162439a Sprinkle a few more const; from Tiago Cunha. 2014-01-21 15:42:44 +00:00
okan
86b149ad25 cvsimport 2014-01-03 15:29:06 +00:00
okan
43ccf4eae0 use consistent types 2014-01-03 15:29:06 +00:00
Christian Neukirchen
0cad4ef6e0 cvsimport 2013-12-13 12:57:57 +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
0dec9e849d cvsimport 2013-07-16 14:30:48 +00:00
okan
4119b5c065 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
93bfc4a5c1 cvsimport 2013-07-10 14:15:58 +00:00
okan
7a7e5cd592 whitespace and style fixes; from Tiago Cunha and one from me. 2013-07-08 15:46:16 +00:00
okan
9a12ca3520 cvsimport 2013-06-20 02:33:57 +00:00
okan
234b8214df move Cursors into conf. 2013-06-17 17:11:10 +00:00
okan
23d84adb5e now that we have conf_screen, which configures individual screens
*after* config parsing, we no longer need to split up display/screen
initialization, so collapse.
2013-06-17 14:08:51 +00:00
Christian Neukirchen
5515a365ba cvsimport 2013-05-29 22:41:51 +02:00
okan
d1eadee922 get rid of long standing XXX: now that we configure screens based on
config options, add the keybinding GrabKey calls here
2013-05-22 16:54:09 +00:00
okan
be72620432 if -> ifdef 2013-05-14 13:39:53 +00:00
okan
6f185bb03c cvsimport 2013-04-14 16:13:17 +00:00
okan
b5f6bd205c makes no sense to set an error handler which uses X_Dpy before XOpenDisplay. 2013-04-12 14:49:16 +00:00
okan
6296efadaa push Screenq into screen_init 2013-04-12 14:46:30 +00:00
okan
f77166194f cvsimport 2012-12-19 15:21:34 +00:00
okan
b848a2b236 simplify config file setup; with Tiago Cunha 2012-12-18 00:14:41 +00:00