Commit graph

618 commits

Author SHA1 Message Date
Tiago Cunha
70be7117b8 Use a red-black tree for the keys. 2012-02-09 17:19:00 +00:00
Reginald Kennedy
f87ef795e2 Remove unused vars.
ok marco
2012-02-09 20:53:48 +08:00
Reginald Kennedy
641cdb0fc6 Fix erroneous keysym for flip_layout in the example key binding configurations. 2012-02-09 17:20:14 +08:00
Lawrence Teo
6dcc4fb8cd Fix height_shrink key binding; use .Xr for xprop(1).
From: Andrea Bolognani <eof@kiyuko.org>

ok marco
2012-02-08 22:19:38 -05:00
marco
961486fa30 fix se layout, from Niclas Zeising <zeising@daemonic.se> 2012-02-08 18:14:59 -06:00
Tiago Cunha
9318d27d45 Remove redundant checks.
Now that the focus_magic function is responsible for updating the
status-bar when there are no windows, remove superfluous checks from a
couple of places that were previously needed.

Fixed a typo in a comment while there.
2012-02-08 22:36:53 +00:00
Tiago Cunha
f0280ca20a Clear status-bar when iconifying the last window.
Make the focus_magic function responsible for updating the status-bar
output when there is no window available. Now, any window related output
gets cleared when iconifying the last available window.
2012-02-08 22:36:53 +00:00
Tiago Cunha
4943ed1dfe Add status-bar wrapper function.
Instead of checking if any of the window related enabled options are set
and updating the status-bar over and over again, delegate that job to a
small wrapper function.
2012-02-08 22:36:53 +00:00
Reginald Kennedy
1bee50dce7 Add flip_layout binding to all keyboard layout examples.
ok marco
2012-02-09 04:10:55 +08:00
Marco Peereboom
4fb8103b11 Prepare for release 0.11.0. 2012-02-08 12:31:58 -06:00
Reginald Kennedy
043047d548 Add flip_layout keyinding.
Swap the master and stacking areas of the horizontal and vertical
layouts.

Default binding: M-S-\

ok marco
2012-02-08 08:47:34 +08:00
Tiago Cunha
b1d1bb4360 Use a tail queue for the spawns.
Instead of hand rolling a dynamic array, just use a tail queue by taking
advantage of the queue(3) macros.

Simplifies the code, since there's no need to (re)allocate the array and
to keep track of its size and length.

ok marco
2012-02-07 23:35:14 +00:00
Tiago Cunha
739a5e6e32 Remove stray spaces.
Prompted by marco.
2012-02-07 23:11:34 +00:00
Tiago Cunha
d13c5e2aa8 Fallback to WM_NAME if _NET_WM_NAME fails.
If requesting the window name with _NET_WM_NAME fails, fallback to
requesting it with WM_NAME. While here, make the property request
through the get_property wrapper function.

Makes scrotwm show the titles for xterm (and probably others) windows.
2012-02-07 23:11:33 +00:00
Tiago Cunha
ea00ae6c78 Use the global display variable. 2012-02-07 23:11:33 +00:00
Tiago Cunha
f4dcc22a55 Remove unused length parameter. 2012-02-07 23:11:33 +00:00
Tiago Cunha
79e879c9ee Remove unneeded atom parameters.
Since the function that retrieves the window title always uses the same
atoms, do not pass them as parameters, but use them internally, instead.
2012-02-07 23:11:33 +00:00
Tiago Cunha
bc0953a3ce Update status-bar when focusing.
While focusing on a window, update the status-bar if any of the window
related enabled options is set, so that its output matches reality.

Easily reproducible by firing up scrotwm and opening a new window.

ok marco
2012-02-07 23:08:36 +00:00
Tiago Cunha
fe1d4ab5ca Use the warn(3) functions instead of fprintf(3).
Rather than using fprintf(3) to display a formatted error message on
stderr (and, occasionally in conjunction with strerror(3)), use the
warn(3) functions. A few cases that also used perror(3) were changed
accordingly, as well.

While there, remove an extra fprintf(3) call in conf_load which is
already followed by an err(3).

ok marco
2012-02-07 23:05:26 +00:00
Tiago Cunha
20f6684161 NUL terminate the strftime(3) buffer.
SUS says that if there wasn't enough space to copy the expanded format
to the buffer, strftime(3) will not NUL terminate it. It would work on
some implementations (eg on OpenBSD), though.

Therefore, take advantage of the return value to prevent using the
character array with unspecified contents with a very large clock
format.

Besides, the strlcat(3) call below relies on the destination buffer
being NUL terminated.

ok marco
2012-02-07 23:02:03 +00:00
Reginald Kennedy
684fc5a3a6 When responding to a ConfigureRequest event without reconfiguring the window,
take into account WM_SIZE_HINTS (if set) when generating the ConfigureNotify
response.

This helps workaround picky apps.

ok marco
2012-02-04 01:58:52 +08:00
Marco Peereboom
39ac9d5d1d be more paranoid when freeing memory and some whitespace fixes 2012-02-03 08:01:09 -06:00
Tiago Cunha
404f5207ef Fix indentation when defining variables.
Prompted by marco.
2012-02-02 23:43:27 +00:00
Tiago Cunha
11120d6ae8 Use a tail queue for the quirks.
Instead of hand rolling a dynamic array, just use a tail queue by taking
advantage of the queue(3) macros.

Simplifies the code, since there's no need to (re)allocate the array and
to keep track of its size and length.
2012-02-02 23:43:27 +00:00
Tiago Cunha
90bd93770a Fix indentation when defining variables.
Prompted by marco.
2012-02-02 23:33:39 +00:00
Tiago Cunha
ae990c02fc Use a tail queue for the key bindings.
Instead of hand rolling a dynamic array, just use a tail queue by taking
advantage of the queue(3) macros.

Simplifies the code, since there's no need to (re)allocate the array and
to keep track of its size and length.
2012-02-02 23:33:39 +00:00
Tiago Cunha
bdd3689b89 Sort configuration file keywords alphabetically. 2012-02-02 21:53:14 +00:00
Reginald Kennedy
5a2b38c1f9 - Add UTF-8 Support.
- Fix several memory leaks.

ok marco
2012-02-02 07:00:45 +08:00
Reginald Kennedy
64b9a6facf Fix response to applications when windows are not reconfigured as requested.
This gives applications a chance to redraw the window contents to the actual, unchanged, window geometry.
Fixes issues with gvim, emacs, firefox, feh and many other applications.

ok marco
2012-02-02 04:50:43 +08:00
Reginald Kennedy
e3fd7d898f scrotwm.c:
- Improve debug output.

- Improve code styling compliance.

- Use the X,Y,WIDTH,HEIGHT macros where applicable on ws_win and swm_region objects.

- Fix handling of _NET_MOVERESIZE_WINDOW client message.

ok marco
2012-01-29 01:29:31 +08:00
Lawrence Teo
f4da59ebb2 Add the missing ws_prior key binding to the keyboard mapping files. 2012-01-25 22:43:25 -05:00
Lawrence Teo
cab6806fae Fix Mdocdate error that I made (it's no longer 2011!). 2012-01-25 22:20:43 -05:00
Reginald Kennedy
bc00007fce Fix 'jump' when moving a non-floated window with the mouse.
ok marco
2012-01-26 00:37:03 +08:00
Tiago Cunha
984840baa4 Document the special MOD modifier key.
ok lteo marco
2012-01-25 01:06:03 +00:00
Niclas Zeising
c4467452a2 Clean up properly in linux/Makefile.
ok marco
2012-01-23 21:03:41 -05:00
Niclas Zeising
4b0b728c4d Fixes to the FreeBSD Makefile.
- Remove X11BASE and replace it with LOCALBASE, since the former is
  deprecated.

- Silently ignore if included files are not found. This way we do not
  depend on the FreeBSD ports tree being installed.

- Add definitions for LOCALBASE and PREFIX in case they are not given
  from the included files.

- Change MANDIR to ${PREFIX}/man instead of ${PREFIX}/share/man, to
  better match reality.

ok marco
2012-01-23 21:00:56 -05:00
Tiago Cunha
8ae086989f Plug memory and file descriptor leak.
Now that asprintf(3) return value is checked in conf_load(), make the
code release the memory returned by fparseln(3) and fclose(3) the
configuration file FILE pointer.

Style nit fixed while there.

ok marco
2012-01-23 19:17:16 +00:00
marco
d857737a4a broken space bar 2012-01-22 09:44:40 -06:00
Reginald Kennedy
4a043e8519 Ignore window crossing events that are generated when the cursor is not actually moved between windows. 2012-01-22 03:46:46 +08:00
Reginald Kennedy
b6f64e3b20 Moving and resizing floating windows with the mouse is now based on click location.
Floating windows are constrained to region on move/resize operations.

Resize center is now based on window center, instead of region center.

Fix several uninitialized/unused variable warnings.

Handle asprintf return value in conf_load.
2012-01-22 03:38:04 +08:00
Lawrence Teo
1bc1f62c7a Plug memory and file descriptor leaks in conf_load().
From: Tiago Cunha <tcunha@gmx.com>

ok marco
2012-01-19 21:43:04 -05:00
Lawrence Teo
71fb537309 Make uniconify work on windows with non-ASCII titles.
ok marco
2012-01-15 14:54:40 -05:00
Lawrence Teo
b4f18a38d0 search_win's key binding should be M-f on the manpage.
Reported by user jrh via the scrotwm forum (thank you!).
2012-01-12 20:37:47 -05:00
Marco Peereboom
febbd42900 Prepare for release 0.10.0. 2012-01-11 12:42:56 -06:00
Lawrence Teo
c9ca43ac66 Fix a crash when mvws_n is used in an empty workspace.
mvws_n invokes send_to_ws(), which in turn calls focus() to focus on
the previous window before sending the current window to the desired
workspace. The TAILQ_PREV() call in focus() will fail if there are no
windows in the current workspace.

This commit adds a safeguard to focus() by ensuring that the list of
windows in the current workspace is not empty and that there is at
least one uniconified window to focus on before proceeding.

This commit also modifies send_to_ws() to set r->ws->focus to NULL if
there are no more windows in the workspace after sending the current
window to another workspace. This fixes an odd behavior where you can
"summon" a window that you have previously moved to another workspace,
even though you are in an empty workspace.

Closes FS#191

ok marco
2012-01-09 20:45:49 -05:00
Lawrence Teo
2288fb7961 Skip iconified windows correctly.
This fixes a bug where the focus_next and focus_prev actions will get
"stuck" when an iconified window is in the way.

ok marco
2012-01-04 21:32:51 -05:00
Lawrence Teo
924aaecaaa Fixes an oversight so that BUILDVERSION gets properly defined, as well
as remove some debug stuff I forgot to remove earlier.

From: Niclas Zeising <zeising@daemonic.se>

ok marco
2011-12-28 21:38:44 -05:00
Lawrence Teo
b93600b201 Makefile and util.h for FreeBSD.
From: Niclas Zeising <zeising@daemonic.se>

ok marco
2011-12-12 23:13:54 -05:00
Lawrence Teo
7d6b9cfdce Reformat CONFIGURATION FILES section for better readability.
From: Tiago Cunha <tcunha@gmx.com>

ok marco
2011-12-12 23:10:30 -05:00
Lawrence Teo
b32473d675 Improve status bar refresh code:
- Refresh status bar (if name/class/title are enabled) when no window
  can be focused, so that the name/class/title will be cleared.

- Handle window class/name change events to refresh the bar when appropriate.

- Move XA_WM_NORMAL_HINTS into the '#if 0' block, since the status bar
  should not need to be updated for that event.

From: Splex <splecks@rejii.com>

ok marco
2011-12-10 22:49:49 -05:00