Commit Graph

327 Commits

Author SHA1 Message Date
yosh 08ae5aeca5 Merge branch 'linux' of https://github.com/leahneukirchen/cwm into patched 2023-04-15 13:53:21 -04:00
op 73cef0ffb0 cvsimport
* refs/heads/master:
  cwm: fix a semi-transparency border issue with some applications
2023-03-22 08:27:36 +00:00
op 9eb763ab87 cwm: fix a semi-transparency border issue with some applications
When running with a compositor the border of some applications (firefox,
chromium, zathura...) is not rendered correctly.  Initializing the highest
significant bits of the color fixes it.

diff from Julien Blanchard (julien at typed-hole [dot] org); ok okan@
2023-03-22 08:27:36 +00:00
yosh 5b5babb21b fix fair layout width/height 2023-01-08 15:02:49 -05:00
yosh cee2b7fc79 warp on close patch 2023-01-05 12:03:00 -06:00
yosh f97d6ade0c fair layout patch 2023-01-05 12:02:36 -06:00
yosh 65b3be249a force tiling patch 2023-01-05 12:01:25 -06:00
okan 7af3a7b8b6 cvsimport
* refs/heads/master:
  cycling fix: when no client is active, warp pointer to last active; from Walter Alejandro Iglesias.
  whitespace
  Fix spelling of some unused MWM hints; from Sean C. Farley.
  Add group-last command that shows only the previously active group; ok okan
  Allow bare numbers for key and mouse bindings; taken from similar support in other parse.y's; from Leon Fischer <lfischer@airmail.cc>.
  sync parse.y changes from base; ok naddy@
  Do not attempt to grab keys without a keycode; this incidentally allows XF86 keys support.
2022-02-27 14:59:55 +00:00
okan 496bcc879d whitespace 2022-02-26 15:19:18 +00:00
okan 5e5221d82d Fix spelling of some unused MWM hints; from Sean C. Farley.
While here, flesh out the rest of the MWM hints.
2022-02-26 15:03:42 +00:00
kn d46f34f01e Keep pointer within window on maximize/fullscreen toggle
Spawn a window, maximize it in any way, move the cursor to a window border
that is not on the screen's edge and unmaximize again:  While the window
goes back the cursor stays at the screen's edge, i.e.  focus is lost to the
underlaying window.

Moving, resizing, tiling or snapping windows in any way always moves the
cursor along iff needed, e.g. using MS-[hjkl] to move a small window from
the center to the edge keeps the cursor within window borders -- no matter
what you do with the keyboard, focus stays on that window.

Make CM-f, CM-m, CM-equal and CMS-equal (default bindings) for toggling
full-screen mode, maximization, vertical maximization and horizontal
maximization of the current window drag the cursor along if needed as well.

OK okan kmos dv
2021-04-22 10:02:55 +00:00
kn f24dd47517 cvsimport
* refs/heads/master:
  Keep pointer within window on maximize/fullscreen toggle
2021-04-22 10:02:55 +00:00
Leah Neukirchen 3a570bb679 cvsimport
* refs/heads/master:
  Fixed memory leak in xu_get_strprop.
  Prevent out of boundary write with configuration files in which too many quoted arguments are stored for other window managers.
  Allow configuring a percentage window size of the master window during htile/vtile actions. From Uwe Werler, with a few manpage tweaks.
  zap stray tabs
  Instead of using _NET_ACTIVE_WINDOW on restart, use the pointer location to determine what client to set active. Reduces a round trip for every window.
  Add support for SIGINT/SIGTERM.
  Simplify conditional construct.
  Trim event_mask to those that the root window actually needs.
  No need to lookup current client early; move to right before it is needed.
  Recommit 1.259, but now with TAILQ_FOREACH_SAFE.
  Revert previous. Causes a crash as reported by Tom Murphy.
  Simplify list markup.
  Plug two memory leaks. Also get rid of a variable that is no longer necessary.
  Remove ColormaskChange from event-mask since there's no event handler.
  Unrelated style fixes, consistency changes and sorting, appropriate dosage/removal of wrappers, simplification of name queue, client cycle joins other kb/mb bound functions.
2020-05-14 23:39:56 +02:00
okan 6407eb9bc1 Allow configuring a percentage window size of the master window during
htile/vtile actions. From Uwe Werler, with a few manpage tweaks.
2020-04-16 13:32:35 +00:00
okan 6c20772841 Instead of using _NET_ACTIVE_WINDOW on restart, use the pointer location
to determine what client to set active. Reduces a round trip for every
window.
2020-03-24 14:47:29 +00:00
tim 3b9b98c024 Recommit 1.259, but now with TAILQ_FOREACH_SAFE.
From and OK okan@

Original commit message:

Plug two memory leaks. Also get rid of a variable that is no longer
necessary.

OK okan@
2020-03-16 17:50:44 +00:00
tim b9213d0a02 Revert previous. Causes a crash as reported by Tom Murphy. 2020-03-14 16:11:09 +00:00
tim d8c7d87737 Plug two memory leaks. Also get rid of a variable that is no longer
necessary.

OK okan@
2020-03-13 20:49:13 +00:00
okan 3d1a8028c2 Remove ColormaskChange from event-mask since there's no event handler. 2020-02-28 13:38:35 +00:00
okan 96275a835d Unrelated style fixes, consistency changes and sorting, appropriate
dosage/removal of wrappers, simplification of name queue, client cycle joins
other kb/mb bound functions.
2020-02-27 14:56:39 +00:00
okan 54d95c0610 cvsimport
* refs/heads/master:
  Allow the 'empty' group clients to be window-{h,v}tile'd.
  Map ('5') and allow mod5mask (altgr) as a modifier.
  add, then use, xvasprintf, checking for appropriate return.
  Ensure the pointer stays within client bounds after a window 'snap' (to edge).
2020-02-07 18:53:41 +00:00
okan 7a88b2bdb2 Allow the 'empty' group clients to be window-{h,v}tile'd.
Behaviour (or lack there of) noticed by Raf Czlonka.
2020-02-07 18:53:41 +00:00
okan 85d88f3304 cvsimport
* refs/heads/master: (23 commits)
  Check the atom type on propertynotify before iterating.
  use screen_find() for xrandr crtc changes
  Find the managed screen from the parent window for client_current().
  Print window id in hex; while here, remove unnecessary newline.
  Similar to keypress event, fetch the screen from the event root window in the buttonpress handler; bail if we don't manage the screen. Allows us to find the current client based on the screen/event root.
  extend verbose logging for key/button events
  [keypress event] turns out we've been checking the wrong window for a matching 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 readibility
  Teach client_current() to use a screen to find the current client instead of iterating over all (fallback if no screen provided for now). Initially convert trivial uses of client_current().
  check cc->gc directly
  zip extra lines
  gc clientq inside groups, instead use the better maintained one per-screen
  shuffle deck chairs: rename group actions to match intent for clarity
  same thing as screen_find()
  Separate out the menu window from the client resize/move geom window; in each case, create and destroy on-demand. Isolate more menu specific code.
  fix a few misplaced (and misnamed) ewmh root window functions
  _NET_WORKAREA needs ngroups, so screen_update_geometry() needs to come after conf_group().
  simplify xftcolor config
  Tie group number and name together during config.
  Move the group index (desktop number) check to the only 2 callers that require checking due to ewmh.
  ...
2019-03-11 15:25:46 +00:00
okan 7c45b87622 Teach client_current() to use a screen to find the current client instead of
iterating over all (fallback if no screen provided for now). Initially convert
trivial uses of client_current().
2019-03-07 14:28:17 +00:00
okan 01be5b4e4a check cc->gc directly 2019-03-07 13:24:44 +00:00
okan aa79351d2e gc clientq inside groups, instead use the better maintained one per-screen 2019-03-07 13:14:41 +00:00
okan 8cd6d1154c Selectively hide and show clients based on state; merge client_unhide() and
client_show().
2019-02-28 13:11:53 +00:00
Leah Neukirchen f4286ad453 cvsimport
* refs/heads/master:
  Add 'group-close-[n]' action to close all windows within specified group.
  simplify screen 'area' usage for initial client placement
  restore order from before r1.248 (vtile/vtile containment changes).
  Rename internal functions to delinate between client remove, delete and xproto delete; 'window-close' is now the proper action, but 'window-delete' as an alias will remain until more interesting changes require breaking configs.
  Limit vtile/htile actions to clients fully within the screen of master client.
  fix missing includes
2019-02-25 19:45:12 +01:00
okan 43cd19378e simplify screen 'area' usage for initial client placement 2019-02-23 19:17:17 +00:00
okan 953cf1ce89 restore order from before r1.248 (vtile/vtile containment changes). 2019-02-22 20:52:13 +00:00
okan 535cf541c8 Rename internal functions to delinate between client remove, delete and xproto
delete; 'window-close' is now the proper action, but 'window-delete' as an
alias will remain until more interesting changes require breaking configs.
2019-02-22 19:40:32 +00:00
okan 044ef5a8cd Limit vtile/htile actions to clients fully within the screen of master client.
from Charles A Daniels.
2019-02-22 14:39:18 +00:00
okan 544b4da339 cvsimport
* refs/heads/master:
  Stop asking for events (NoEventMask) from menu window once done with the menu (we don't destroy it, only unmap).
  Allow 'transientfor' clients to inherit group and bwidth either during init or 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.
  merge from base, from sashan@:
  Use the original client border width to adjust initial placement of clients containing {P,US}Position requests where they are explicitly set to 'ignore' in cwmrc(5); clients are unaware that their border will be altered (removed in this case) when calcuating position and thus end up a factor of their original border width off once mapped by cwm(1). cwm(1) will essentially shift the client to the edge if the original request's position and border match.
2018-11-14 19:22:51 +00:00
okan 194589eb6b Allow 'transientfor' clients to inherit group and bwidth either during init or
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.
2018-11-13 17:37:13 +00:00
okan a63b87e315 Use the original client border width to adjust initial placement of clients
containing {P,US}Position requests where they are explicitly set to 'ignore' in
cwmrc(5); clients are unaware that their border will be altered (removed in
this case) when calcuating position and thus end up a factor of their original
border width off once mapped by cwm(1). cwm(1) will essentially shift the
client to the edge if the original request's position and border match.

Window offset noticed by at least Andre Stoebe via bugs@, and others since
(and likely before). Thanks!
2018-11-08 15:49:42 +00:00
okan f3211427c1 Use screen's saved view instead of re-querying the server. 2018-02-06 15:05:20 +00:00
okan 63ebc0cd8b cvsimport
* refs/heads/master: (28 commits)
  Use screen's saved view instead of re-querying the server.
  Slightly expand and expose verbose debugging.
  add debugging for x events
  Add a simple debug logging mechanism.
  Simplification; use asprintf where appropriate now.
  Use func attributes where appropriate.
  Fix wins comparison declaration since it's unsigned from XQueryTree().
  Generate name_to_func[] in a clean and readable fashion.
  Shrink tier[] by one after removing matchname in r1.55.
  If the requested group number is invalid, bail but don't kill cwm.
  Quick fix: exit after a failed execvp in u_spawn instead; previously we did in u_exec, but the introduction of re-exec'ing the previous invocation of cwm if 'exec_wm' failed missed the 'exec' failing path. Will likely split out as a proper fix.
  Only exec the fallback when in CWM_EXEC_WM state.
  Typo, from Julien Steinhauser.
  Convert menu-exec-wm from an abritrary exec menu, into a config-based menu from which one may configure (wm <name> <path_and_args>) (and choose) specific window managers to replace the running one. 'wm cwm cwm' is included by default.
  As done for buttonrelease, work specific un-cycling and un-highlighting actions into the keyrelease event, only performing what's actually needed for each; should result in much fewer events against keyreleases. No intended behaviour change.
  Merge group_toggle_membership_leave into the buttonrelease event and only do border work for a group/ungroup action.
  add helper function client_show to bring together like actions for unhide/raise
  Add support for re-exec'ing with SIGHUP; equivalent to the already built-in 'restart' function.
  Use poll and XNextEvent to replace XNextEvent blocking inside the x11 event handler.
  zap stray that snuck in
  ...
2018-02-06 15:05:20 +00:00
okan 43db5b55ea As done for buttonrelease, work specific un-cycling and un-highlighting actions
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.
2017-12-29 18:50:43 +00:00
okan 5ddaed415c add helper function client_show to bring together like actions for unhide/raise 2017-12-29 12:54:54 +00:00
okan c5d03b0853 Fix a few comments and while here, wrap some long lines. 2017-12-22 21:21:44 +00:00
okan bc5215f41a Add support for _NET_WM_STATE_SKIP_PAGER and _NET_WM_STATE_SKIP_TASKBAR; eerily
close to cwm's 'ignore'.

Roughly based on an initial diff from Walter Alejandro Iglesias, but with
support for both Atoms and without cwm-based bindings.
2017-12-19 14:30:53 +00:00
okan 4040f112e1 cvsimport
* refs/heads/master:
  drop obsolete comment
  Alter callbacks to take a struct instead of a growing number of arguments; greatly simplifies upcoming work.
  Ensure clients stay within the viewable bounds on placement, even with empty borders; based on a patch from Vadim Vygonets.
  Clean up, unify and accurately calculate edge distance with client move/resize actions, so as to not lose windows off the edge.
  Switch bwidth type; unfortunately X11 is inconsistent.
2017-05-09 18:43:40 +00:00
okan 189a735eaa Ensure clients stay within the viewable bounds on placement, even with empty
borders; based on a patch from Vadim Vygonets.
2017-05-05 14:14:19 +00:00
okan 3d6ff6dabf Clean up, unify and accurately calculate edge distance with client move/resize
actions, so as to not lose windows off the edge.

inspired by diffs (and feedback) from Vadim Vygonets.
2017-05-01 12:54:55 +00:00
okan 4d85e2e2a6 Switch bwidth type; unfortunately X11 is inconsistent. 2017-04-26 21:10:54 +00:00
okan 2d9185129b cvsimport
* refs/heads/master:
  The r1.36 menuq_add() conversion did this one wrong; fix by reverting to the original code which adds to resultentry list, as opposed to the wrong one in menuq_add(). Fixes crash noticed by at least Rickard Gustafsson.
  Remove 'noresult' (and simplify) as it does nothing and makes the logic around it needless. History doesn't show what this might have been used for in future iterations.
  search_match_path() isn't supposed to return anything.
  Move queue init to caller so it's only called once in a few cases.
  sort
  Raise the previously focused window, instead of the previous window in the cycle list; seems to match behaviour of other wm's; from Walter Alejandro Iglesias.
  For {h,v}tile, instead of keeping the master client's {h,v} geometry, expand it to %50 of the area, then fill in the remaining space with the other clients in the same group; from Gerrit Meyerheim.
2017-04-25 13:40:33 +00:00
okan 15a6fcc851 sort 2017-04-24 13:31:19 +00:00
okan 9b56325908 Raise the previously focused window, instead of the previous window in the
cycle list; seems to match behaviour of other wm's; from Walter Alejandro
Iglesias.
2017-04-24 12:27:32 +00:00
okan 50dd70afc5 For {h,v}tile, instead of keeping the master client's {h,v} geometry, expand it
to %50 of the area, then fill in the remaining space with the other clients in
the same group; from Gerrit Meyerheim.

support from ajacoutot.
2017-04-24 12:18:04 +00:00
okan ab8da61802 cvsimport
* refs/heads/master:
  Fix group hidden state when a client wants to be on all desktops on start; reported by Vadim Vygonets with diff, but another approach was taken.
  Call client_resize instead of client_move after client_placecalc since the size may also change.
2017-02-10 15:00:54 +00:00