Wikia

Sawfish

Patches (all)

Talk0
772pages on
this wiki

Welcome to the collection of all patches considered for applying to Sawfish. Here you can add new patches or review submitted patches for inclusion into SVN tree. A patch is included/rejected when sufficient number of people provided a good reasoning for such decision.

How to prepare a patch

To add a new patch (licensed under GPLv2), write the name and click below

To review a submitted patch please try it and
  • Write your verdict, using one of wiki templates below:
    • {{yes}} ( Yes vote: yes. ),
    • {{no}} ( No vote: no. ),
    • {{wtf}} ( Wtf vote: pondering. ),
    • {{try}} ( Try vote: let's try in experimental. ) and
    • {{suspend}} ( Suspend wait for next release. ).
  • Write your reasoning, please be as specific as possible - explain what it corrects, try to prove that this patch does not introduce new bugs, etc. Or on the contrary - point out what's wrong with the patch.


Submitted patches Suspended patches Accepted patches Rejected patches


Accepted Patches

PatchAuthorDescription

Focus grabs aren't focus changes

Harald van Dijk

When a window grabs focus, sawfish doesn't treat it as a "focus out" of the old window, but does treat it as a "focus in" of the new one. This causes problems with Global Menu Bar for GNOME: when opening a menu, the menu grabs keyboard input. In sawfish, as a result, the GNOME top panel (or wherever you have placed the menu) becomes focused, and the menu bar is updated to reflect that no application window has focus. In short, the menu bar is completely unusable. The patch made focus_in ignore the same events that focus_out already ignores, but was updated after comments on the mailing list to only affect the _NET_ACTIVE_WINDOW property so that all other focus-related functions (including updating the window frame) get called, and to update mode_to_sym to handle NotifyWhileGrabbed events.

Note that even with this patch, it is necessary to force the GNOME panel to "never focus". The panel is focusable in sawfish and fluxbox, which causes the same problem even without opening menus, but that is not a bug in the window manager, and easily worked around using for example Window Rules from the Sawfish Configurator.

Accepted for 1.3.1

PatchAuthorDescription

Buffer overflow in fonts.c

Yoshiaki Kasahara

When I was trying to compile the source from svn on my FreeBSD box, I noticed one of port-local patches wasn't incorporated into the svn tree The following patch is for the stock 1.3 release, but it should be applied to the svn source, too.

ShapeInput in events.c

Michal Jaegermann

I tried to rebuild 1.3.1 on "CentOS release 4.5" installation and run into a minor problem that although a code in src/frames.c checks if 'ShapeInput' is available this is not the case in src/events.c. The following patch solves the issue:

Accepted for 1.3.2

PatchAuthorDescription

Multihead placed patch

Fuchur

This patch fix window placement with multihead setup. Look here

KDE menus focus

Harald van Dijk

Don't grab focus on KDE menus.

KDE system tray fix

Timo Korvola

Ignore out of bounds _NET_CURRENT_DESKTOP requests silently.

KDE system tray apps have a nasty habit of sending _NET_CURRENT_DESKTOP client messages with a parameter of -1, which confuses Sawfish. This patch adds some bounds checking.

Net wm properties

Rodrigo Gallardo <rodrigo@nul-unu.com>

This patch makes sawfish use the _NET_WM_NAME properties for window names, as mandated by the EWMH spec (http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html)

This patch is a bit more invasive that it seems requiered, because, to make it work properly in my system I had to make sawfish assume all strings are UTF8 encoded (see the pieces of the patch touching fonts.c)

Please test it and tell me what breaks. If there are no objections to the substance of the patch, I'd still like some feedback on what to do with text rendering with "normal" xlfd fonts.

Reparenting cleanup

Timo Korvola

This fixes reparenting fights that occur between Sawfish and the KDE system tray. Both try to reparent system tray icons as they are mapped, leading to a lot of flicker and an unpredictable end result. After the patch, Sawfish will reparent windows to their frames at MapRequest time, never at MapNotify. Also, windows that are unmapped by the client should normally be reparented to the root, but if the unmapping was caused by the window being reparented by some other client, problems ensue. So we check for that.

The patch also fixes an exotic race condition triggered at least with old versions of Monodevelop #308155 and Gnome Power Manager. Current versions of both programs don't expose the issue anymore. It was discussed on the mailing list on february 2007 and the follow up march 2007. There's a proof of concept available that should demonstrate the bug, a window isn't decorated if unmapped during the first reparenting.

Blank lines in prompt

Sven Schoenung

The window opened by the prompt function shows two blank lines before the prompt even when they aren't needed.

Noprop desktop save

Luis Rodrigo Gallardo Cruz

Sawfish saves the size of the desktop window, and although nautilus requests the widget to be the same size as your screen it's forced to the size that sawfish saved..

This patch is currently applied in the Debian package.

bugzilla bugreport

debian bugreport

Update desktop file

Rodrigo Gallardo

The current Sawfish.desktop file does not comply with the freedesktop.org standard.

Fix select workspace

GSR

Fixes select-workspace in lisp/sawfish/wm/workspace.jl to make sure it uses key params in its call to select-workspace*

This patch is currently applied in the Debian package.

debian: http://bugs.debian.org/413584

Fix Xlib client message

Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org>

This is a patch for Debian bug #406559, and possibly #403100, too. It seems these are ultimately caused by Xlib "helpfully" converting 32 bit messages from the server to the client's native long type, which is bad for sawfish since rep does distinguish these.

A longer description can be found in the patch's author's message in [1].

Accepted for 1.3.3

PatchAuthorDescription

Pango draw() ignores font

Yuuki Harano and Rodrigo Gallardo

~/.sawfishrc:

(setq test-font1 (get-font-typed "pango" "Arial Italic 8"))
(setq test-font2 (get-font-typed "pango" "Arial Italic 20"))

(define (test-update w type)
  `(((background . "white")
     (foreground . "black")
     (text . ,window-name)
     (left-edge . 0)
     (right-edge . 0)
     (top-edge . -20)
     (height . 20)
     (font . ,(if (equal (window-class w) "XTerm") test-font2 test-font1))
     ))
  )

(add-frame-style 'test test-update)

~/.sawfish/custom is empty.

Then, text in title bar of xterm should be large font, and other title bar should be small font. But all is large.

pango_context is created and set font with fontdesc in pango_load(), and used in pango_draw() without font changes. So, only one font is used.

You should set font before using pango_context in pango_draw().

Utf 8 names fix

Timo Korvola

Patch against 1.3.2. To illustrate the difference, run Sawfish in a non-UTF-8 locale but with a title font capable of displaying Unicode (I use Freemono), start a uxterm and gucharmap, then try xterm -T 'funny characters' and konsole -T 'funny characters', where the funny characters are not representable in the locale of Sawfish. With the Net_wm_names patch, only konsole gets its title rendered correctly but xterm does not. With the attached patch, both windows get correct titles.

See this post and this post

Titlebar updates

Harald van Dijk and Timo Korvola

When using a theme which updates itself as window titles change, such as the default theme Crux, the updates happen at the wrong time, and the title bar ends up messed up. When the netwm patch is applied, you can easily see this by normal browsing in Mozilla Firefox, or editing a document in editors that update the title to include "*" or "modified" when you start typing. This happens because the themes look for updates to the WM_NAME property, but sawfish now reads the _NET_WM_NAME property as well, so themes should check for updates to that too. This patch updates the default themes, and to prevent custom themes (not distributed with sawfish itself) from breaking, treats (call-after-property-changed 'WM_NAME ...) as a special case that should also check for _NEW_WM_NAME.

KDE tray fix 2

Timo Korvola

Another KDE system tray fix. The diff is against 1.3.2. The essential content is the one-line change in wm-spec.jl but I am bundling it with some other cleanups.

As of 3.5.8, KDE has still not completely replaced their old wm-dependent system tray protocol with the freedesktop.org one. They just kluged it: KDE apps continue to use the old protocol, but a kded module called kdetrayproxy tries to perform the part of the wm in that protocol and docks the tray icons using the freedesktop.org protocol.

It turned out that kdetrayproxy watches for new windows not by monitoring MapNotify events but by monitoring changes in the _NET_CLIENT_LIST root window property. Sawfish added windows to that list at a very early stage, before they had even been decorated. The result was kdetrayproxy being confused by the events caused by Sawfish decorating the window and Sawfish being confused by interference from kdetrayproxy. This patch delays the update of _NET_CLIENT_LIST to map-notify-hook. At that time the new window is already mapped (unless it starts iconic - map-notify-hook is executed even in that case).

This patch also fixes a potential problem of reparent-notify-hook getting called with a removed window. I have never seen anyone use that hook though. I also modified unmap_notify so that removal of WM_STATE is the very last action there. That property change indicates to the client that we are done processing the window withdrawal. The client may then reuse the window, e.g., remap it.

You can also get this patch with Git from http://www.elisanet.fi/tkorvola/sawfish.git, branch kde-tray-fix-2.

Accepted for 1.3.4

PatchAuthorDescription

Selfdefine xterm command

Dagfinn Ilmari Mannsåker

(Uploaded by Christopher Bratusek)

taken from: http://bugzilla.gnome.org/show_bug.cgi?id=71895

This patch allows that the user-defined 'xterm' command is also used, then viewing the info file.

Enter-Click Focus Mode

Dagfinn Ilmari Mannsåker (Original Author)

Christopher Bratusek (Update against 1.3.3)

Timo Korvola (Simplyfied Code)

taken from: http://bugzilla.gnome.org/show_bug.cgi?id=72238

This patch defines a new focus mode, the union of enter-only and click.

This is useful when one wishes to focus a window that has the mouse pointer in it (this occurs frequently when the mouse pointer is not warped to focuesd/cycled windows)

Maximize fullscreen xinerama

Jonathan Sambrook (Uploaded by Christopher Bratusek)

A hacky patch for maximizing windows fullscreen in the xinerama

Stacking-visibility

Timo Korvola

Fixes things to work better with the Composite extension.

Adds new functions window-obscured and stacking-visibility, which compute window visibility from the stacking order and do not rely on VisibilityNotify events. Modifies raise-lower and grow-pack to use these functions instead of window-visibility. VisibilityEvents appear unreliable when Composite is in use: every window is reported unobscured by window-visibility.

This patch is also available via Git from branch stacking-visibility at http://www.elisanet.fi/tkorvola/sawfish.git and you should pull it from there because Wiki may have messed with the formatting here.

Add Elberg-tabbed theme

Scott Scriven (ToyKeeper 00:13, 7 August 2008 (UTC))

Adds the Elberg-tabbed theme to themes/

Cycle-hook

Teika kazura

This patch adds a new hook `cycle-hook' which is called each time you cycle windows. The timing corresponds to the release of tab key in Windows.

I have updated the patch recently. Formerly it was a plain hook, but it is now a window hook. The manual is written too.

Add mxflat theme

Christopher Bratusek (Patch) tooar (Theme)

Add the mxflat theme. it's fast, highliy configurable and supports a lot of buttons. Ideal for daily use and as showcase. Scott said, he might add tab support to it.

Window prop list & prop del

Teika kazura and Timo Korvola

This patch defines two functions, `window-plist' and `window-prop-del'.

  • `window-plist' returns the property list of a window.
  • `window-prop-del' deletes a property of a window.

Both lack in the current sawfish.

The idea is suggested by Timo Korvola in the page of Focus policy improvement. The author thanks him.

Add get-S-tabbed theme

Scott Scriven (ToyKeeper 10:30, 5 August 2008 (UTC))

Adds the tabbed version of "get-S" into themes/.

Update desktop file (again)

Christopher Bratusek

Recent versions of gnome-window-properties don't run sawfish-ui, because of the out-dated desktop file.

This patch will also replace the capplet, which can then be safely removed from trunk.

For GNOME-Session 2.23 this desktop file is also used, to set the default window-manager, via the

/desktop/gnome/session/required-components/windowmanager

gconf-key, since some user might think {s,}he has to set the value to the binary-name, we should rename the file from "Sawfish.desktop" to "sawfish.desktop", for consistency and to avoid confusion.

L10n update

Christopher Bratusek

Update the pot file, the po files and remove deprecated strings.

Window menu item shortcuts

Fernando Carmona Varo and Guillermo S. Romero

The keyboard support for menu items is not very good in sawfish in my opinion, making menus kind of ankward to use if you are not using a mouse.

This patch activates some chars of the menu items to be used as shortcut keys.

for example, if you have Alt+Space as a key-binding to popup the menu, you will be able to maximize the window pressing "Alt-Space x" ...or make it be always on top pressing "Alt-Space i u". Kind of key chain shortcuts.

Also, the patch adds "Move" and "Resize" that were missing.

Keep Focus on move-window- direction ()

Mark Schreiber

(Uploaded by Christopher Bratusek)

taken from: http://bugzilla.gnome.org/show_bug.cgi?id=69520

Focus behaviour changed from 1.0 to 1.0.1-20020116:

The behavior used to be such that when I invoke the command move-window-<up, right, down, left>(), the window I move would always get the new focus on the viewports it got moved to.

The behavior in the new version of sawfish is such that the previously focused window on the viewport I move to gets the focus instead, and the window that I am moving loses focus (and seems to go to the back of the focus-stack).

This makes it difficult to move a single window across many viewports, since I might start out with a galeon in the upper-right -- but end up with an rxvt in the lower-left.

Remove .cvsignore files

Christopher Bratusek

We use SVN now. So no need for .cvsignore files.

Major C-Part Clean-Up

Christopher Bratusek

Major cleanup for Sawfish's c-part. Fixes most of the compiler-warnings and makes possible to build sawfish with CFLAGS="-Wall -ansi -pedantic" (previously: 68 (and build failed at fonts.c) / now: 9).

Ok building with CFLAGS="-Wall -ansi -pedantic" still fails, but this time it's not Sawfish's fault, it's the fault of two librep headers.

I'll therefore make clean-ups to librep and rep-gtk, too (not before 2 or 3 weeks, so be patient).

Decorations toolbar windows

Andrea Vettorello

I can't find in the EWMH specs how should be managed a window with _NET_WM_WINDOW_TYPE_TOOLBAR property enabled, but in this email http://mail.gnome.org/archives/wm-spec-list/2002-July/msg00002.html is stated that a toolbar should be decorated by the toolkit not the window manager.

Negative-property-p

Teika kazura

This patch improves the treatment of the boolean property of the window. It modifies the function `window-get', by adding an optional argument. It has no side effect (I mean the ordinary, not lisp side effect), not requiring any fix in existing codes.

The author thanks Tkorvola for the useful comment.

UsageEdit

(window-get window prop &optional checker)

The function `window-get' returns the value of the property PROP of WINDOW.

The current version of `window-get' returns nil either when the property value is nil, or the property is not set at all. There isn't a way to distinguish these two different situations.

In this patch, the function can take an optional argument CHECKER. If it is non-nil and PROP is unset, then it returns CHECKER.

NotesEdit

As a practical application of this patch, see my another patch focus policy improvement.

If this patch is to be accepted, then I would write the manual entry, too. The patch for the manual is now included. -Teika kazura 05:24, 25 June 2008 (UTC)

Thank you for reading.

Configure update

Christopher Bratusek

Bump version requirements: - pango 1.16 - gtk 2.6 - gdk 2.6

Also includes the version bump for sawfish to 1.3.4

Refresh icons

Timo Korvola

The Crux theme uses miniature versions of client icons in the window menu buttons. The scaled pixmaps are cached and are not updated if a client changes its icon. This patch fixes that.

You can also get this patch with Git from http://www.elisanet.fi/tkorvola/sawfish.git, branch icon-refresh.

Add POTFILES.in

Christopher Bratusek

Adds a POTFILE.in to make intltool-update work.

This patch is needed by my updated Fix make-pot patch.

Fix make-pot

Christopher Bratusek

Due to a wrong command the make-pot script is unable to update the pot file.

The updated version of this patch depends on this patch: Add POTFILES.in

Following patch fixes the issue.

Parallel make patch

Harald van Dijk

This patch fixes the parallel build bug that can result in:

(compiling sawfish/wm/commands/x-cycle.jl)
error--> (file-error "No such file or directory" "sawfish/wm/util/x")

When make is run with -j2 (or higher), it's possible that src/fake-libexec gets executed before the targets of the symbolic links it is supposed to create exist. src/.libexec will be incomplete if this happens, and make fails in lisp. This patch tells make to not run src/fake-libexec before the build is ready.

Update the Spec-file

Ian Dall

(Uploaded by Christopher Bratusek)

taken from: http://bugzilla.gnome.org/show_bug.cgi?id=520040

The Spec-file shipped with Sawfish is useless, since some keywords have changed.

This patch solves that issue.

Accepted for 1.3.5

PatchAuthorDescription

Re-expose smart placement modes

Christopher Bratusek

Add back the Smart placement modes "best-fit" "best-fit-group" and "first-fit-or-interactively" to the list of placement modes in SawfishUI

Slide-window-hook

Andrea Vettorello

This patch adds a new hook `before-slide-hook' which is called every time a window is moved using the keyboard. The code is executed before the actual move. I need an hook like this to fix stop-focus.jl mode, in particular it's used to update the mouse pointer position when moving windows with the keyboard. I've updated the documentation accordingly.


Re-expose extra placement modes

Andrea Vettorello

Brings back "stagger" and "off-center" placement modes.

A11y changes (Sawfish/Rep)

Shobbit Mathur

(Uploaded by Christopher Bratusek)

Sawfish-ui is not "accessible" currently.

Provide "atk" relation between widgets and corresponding labels.

There are two patches one for sawfish and one for rep-gtk.

Support NET WM USER TIME

Helmut Eller <eller.helmut at gmail.com>

This patch adds minimal support for the _NET_WM_USER_TIME hint. If this property is 0, Sawfish shouldn't give focus to the window when it is mapped. GTK uses this hint to implement gtk_window_set_focus_on_map.

The patch looks at the _NET_WM_USER_TIME and if it is zero, puts a the new property inhibit-focus-when-mapped on the window. It seemed to me, that inhibit-focus-when-mapped makes the intention clearer than comparing the timestamp with 0.

The map-notify-hook in transient.jl ignores windows if the property is set.


Fix Theme Installation

Christopher Bratusek / Michal Jaegermann

Fix mxflat theme installation, by installing themes as gzip'ed tarball. (Patch by Michal Jaegermann, update for applying against trunk by me)


Add error-handler both

Christopher Bratusek

Print errors both on the screen and the standard-error

Viewport boundary

Christopher Bratusek

This adds viewport-boundary (same as workspace-boundary, just for viewports)


Re-expose Keybindings

Christopher Bratusek

Brings back all "missing" keybindings to sawfish-ui


2 new button layouts for Crux

Christopher Bratusek

Patch to (finally) close #103520

Adds two new button layouts to Crux: Complete and Complete (Inverse)

Complete: close == shade iconify maximize menu Complete (Inverse): menu maximize iconify shade == close

Docu Update

Christopher Bratusek

Updated version of: http://mail.gnome.org/archives/sawfish-list/2008-September/msg00067.html

But this one also updates the header information (version, edition, mod-date, mod-month)


No more Control-l

Teika kazura

This patch removes Control-l (printed ^L in less, emacs, etc) in source files. The affected files are:

  • C-sources
  • lisp files
  • OPTIONS, TODO
  • po/sawfish-xgettext
  • scripts/sawfish-menu.jl
  • themes/Crux/theme.jl, themes/smaker/theme.jl

COPYING and themes/mxflat/GPL are omitted.

No other files contain them. (Of course excluding images and sounds.)

Pros Edit

  • Control-l annoys patch submitters.
  • Developpers who don't know what this Control-l is remain puzzled during their work.

I fall into both of these categories :).

Scroll viewport patch

Fernando Carmona Varo (script by Andreas Bombe)

This patch is based on Scrolling-viewport-switches script. It adds an option for switching viewports by moving a number of steps.

The original script does not work, as it needs viewport.jlc to be reloaded (and reloading it unsets the script changes). So I thought it would be better to make a patch for it to make it work, being integrated. I also modified it a bit for slightly better performance (previously it was doing 2 unneeded calls).

The maximum number of steps (slowest scroll) is set to 100. In my computer 100 is slow (well.. as intended) but works fine. However, it is maybe possible that older computers have problems, so maybe it's a good idea to test it and set a better number. The same can go for the default steps (5), I don't know if the feature would better be disabled by default (setting it to 1).


Honoring ICCCM aspect ratio

Andrea Vettorello

With this patch Sawfish honors aspect ratios when resizing a window interactively.

Accepted for 1.5.0

PatchAuthorDescription

Sawfish UI Rework

Christopher Bratusek

We discussed about a new sawfish-ui, but this will take longer ... So I'm going to optimize what we actually have. And this is the result. Tell me what you think.

  • Currently the TreeView only listens to double-clicks, does anyone know, how to make it listen to single-clicks?


Cycle-groups (only cycle to the top windows of each group)

Fernando Carmona Varo

This patch adds a new command to cycle to different groups, which is useful if combined with "cycle-group" (cycles to windows of the same group). Also, the flexibility of sawfish groups (by means of window-matching) can be an advantage when using this command.


Translate custom options in ui

Alexey I. Froloff (ALT Linux)

Translate custom options in sawfish-ui.

Clean-up for Zimmerman's iconify patch

Teika kazura

This patch improves Ian Zimmerman's iconify patch (IZIP hereafter). It was commited as rev4373.

This patch restores the code in 'events.c' which was removed by IZIP, and put it in windows.c -> add_window. It replaces the addition by IZIP.

Backgrounds Edit

1. Setting 'iconify->no' in Sawfish configurator does nothing, contrary to the common sense. So sawfish can iconify non-icon initial-state windows as a user setting, but it can't un-iconify iconified-init-states as a user setting. That's because sawfish's property had not provided distinction between 'unset' and 'set nil' until summar of 2008. Desirably it be fixed, but it is a bit tedious task, taking consistency check into account. I just postpone this issue, being satisfied to have recorded it at wiki.

2. There had been a subtlety, but in my opinion not a bug, which was pointed out by Ian Zimmerman. Ian's patch solves it.

It's that even after the prob 1 is solved by hacking lisp codes, event.c -> map_request hinders the effort. That's because it calls 'iconify' after window matching, which is done in windows.c -> add_window. It was solved by IZIP.

3. Ian's patch works, but in ugly way. It uses XIconifyWindow which is for clients' use. As a result, a window which should be iconified appears once un-iconified, and it soon gets iconified. You can see something flash on your screen for a moment. It also takes away the focus. Such implementation can be a seed of bug.

Also the wrong comment is added to the source: "There's a minor downside: rep doesn't know about this, so any hooks that might be operative for iconification don't get run..." No. Eventually sawfish iconifies the window, so hooks is called.

4. This is solved by this patch. It now iconifies the window in windows.c -> add_window, before 'before_add_window_hook' where matcher is called. Because add_window is called only from map_request, this is permissible.

Drop *.jl.gnome

Sir Raorn (ALT-Linux/Original Patch)

Christopher Bratusek (Dropping *.jl.gnome/Additional Work)

This patch fully drops *.jl.gnome. Currently sawfish's configure script knows --enable-gnome-widgets, which will load *.jl.gnome instead of *.jl.gtk (icon.jl.gnome instead of icon.jl.gtk for example), since *.jl.gnome depends on rep-libgnome, rep-libgnomeui, rep-libgnomecanvas (part of rep-gtk) which depend on deprecated libs, I want to drop those files. Instead make the *.jl.gtk default, also remove the .gtk suffix, which is unnessacary then, if there's only one possibility. I want to drop libgnome/libgnomeui/libgnomecanvas from rep-gtk, but I first need to drop those files from sawfish.

Fix sawfish server connection

Alexey I. Froloff (ALT Linux)

Without this patch sawfish does not accept connections from sawfish-ui and sawfish-client with error:

$ sawfish-ui 
eval_req: Broken pipe
*** Remote sawfish error: unknown error

Broken by SVN revision 4275.

Warp-if-necessary when cycling

Christopher Bratusek

This will (if warp-to-window-enabled and cycle-raise-windows are t) warp the pointer to windows while cycling.

Since the former is disabled by default. It shouldn't make a difference for most people.

Warp-if-necessary when unmaximizing

Fernando Carmona Varo

This is a very simple patch but maybe a bit hard to make a decision about it too, since it's related to focus management and maybe changing the behavior could disturb someone accustomed to it.

It has not been much time since I started using the focus enter-only mode. And I've found it is a quite nice way to work. I like the fact that the mouse follows the focus when I change windows to prevent focus loss. However, sometimes when you unmaximize a window the focus is lost. If you were previously working on the maximized window you often won't be able to know where the focus will end up.. I think this is kind of uncomfortable.

I've added a "warp-if-necessary" at the end of the unmaximizing function. This will warp the mouse if it is out of the window and the "warp-to-window-enabled" option is enabled. However, I'm thinking that maybe some people accustomed to unmaximizing using the mouse might find uncomfortable to have the mouse warped when they click the maximized button, and yet they maybe still want enter-only focus and warping in the other cases. So, I'm thinking of maybe set a condition for the warping and only perform the action if the last-event was not a "Click" (by means of... (unless(string-match "Click" (event-name(last-event))) ...) However, as I normally maximize/unmaximize using the keyboard, I'm not sure if it would really be uncomfortable for such persons. So I'll just put here the patch and wait for your comments.

In the worst case, this could be easily made a script too, since there's a handy hook in there.

Accepted patches

PatchAuthorDescription

Pango draw() ignores font

Yuuki Harano and Rodrigo Gallardo

~/.sawfishrc:

(setq test-font1 (get-font-typed "pango" "Arial Italic 8"))
(setq test-font2 (get-font-typed "pango" "Arial Italic 20"))

(define (test-update w type)
  `(((background . "white")
     (foreground . "black")
     (text . ,window-name)
     (left-edge . 0)
     (right-edge . 0)
     (top-edge . -20)
     (height . 20)
     (font . ,(if (equal (window-class w) "XTerm") test-font2 test-font1))
     ))
  )

(add-frame-style 'test test-update)

~/.sawfish/custom is empty.

Then, text in title bar of xterm should be large font, and other title bar should be small font. But all is large.

pango_context is created and set font with fontdesc in pango_load(), and used in pango_draw() without font changes. So, only one font is used.

You should set font before using pango_context in pango_draw().

Sawfish UI Rework

Christopher Bratusek

We discussed about a new sawfish-ui, but this will take longer ... So I'm going to optimize what we actually have. And this is the result. Tell me what you think.

  • Currently the TreeView only listens to double-clicks, does anyone know, how to make it listen to single-clicks?


Cycle-groups (only cycle to the top windows of each group)

Fernando Carmona Varo

This patch adds a new command to cycle to different groups, which is useful if combined with "cycle-group" (cycles to windows of the same group). Also, the flexibility of sawfish groups (by means of window-matching) can be an advantage when using this command.


Translate custom options in ui

Alexey I. Froloff (ALT Linux)

Translate custom options in sawfish-ui.

Clean-up for Zimmerman's iconify patch

Teika kazura

This patch improves Ian Zimmerman's iconify patch (IZIP hereafter). It was commited as rev4373.

This patch restores the code in 'events.c' which was removed by IZIP, and put it in windows.c -> add_window. It replaces the addition by IZIP.

Backgrounds Edit

1. Setting 'iconify->no' in Sawfish configurator does nothing, contrary to the common sense. So sawfish can iconify non-icon initial-state windows as a user setting, but it can't un-iconify iconified-init-states as a user setting. That's because sawfish's property had not provided distinction between 'unset' and 'set nil' until summar of 2008. Desirably it be fixed, but it is a bit tedious task, taking consistency check into account. I just postpone this issue, being satisfied to have recorded it at wiki.

2. There had been a subtlety, but in my opinion not a bug, which was pointed out by Ian Zimmerman. Ian's patch solves it.

It's that even after the prob 1 is solved by hacking lisp codes, event.c -> map_request hinders the effort. That's because it calls 'iconify' after window matching, which is done in windows.c -> add_window. It was solved by IZIP.

3. Ian's patch works, but in ugly way. It uses XIconifyWindow which is for clients' use. As a result, a window which should be iconified appears once un-iconified, and it soon gets iconified. You can see something flash on your screen for a moment. It also takes away the focus. Such implementation can be a seed of bug.

Also the wrong comment is added to the source: "There's a minor downside: rep doesn't know about this, so any hooks that might be operative for iconification don't get run..." No. Eventually sawfish iconifies the window, so hooks is called.

4. This is solved by this patch. It now iconifies the window in windows.c -> add_window, before 'before_add_window_hook' where matcher is called. Because add_window is called only from map_request, this is permissible.

Selfdefine xterm command

Dagfinn Ilmari Mannsåker

(Uploaded by Christopher Bratusek)

taken from: http://bugzilla.gnome.org/show_bug.cgi?id=71895

This patch allows that the user-defined 'xterm' command is also used, then viewing the info file.

Enter-Click Focus Mode

Dagfinn Ilmari Mannsåker (Original Author)

Christopher Bratusek (Update against 1.3.3)

Timo Korvola (Simplyfied Code)

taken from: http://bugzilla.gnome.org/show_bug.cgi?id=72238

This patch defines a new focus mode, the union of enter-only and click.

This is useful when one wishes to focus a window that has the mouse pointer in it (this occurs frequently when the mouse pointer is not warped to focuesd/cycled windows)

Drop *.jl.gnome

Sir Raorn (ALT-Linux/Original Patch)

Christopher Bratusek (Dropping *.jl.gnome/Additional Work)

This patch fully drops *.jl.gnome. Currently sawfish's configure script knows --enable-gnome-widgets, which will load *.jl.gnome instead of *.jl.gtk (icon.jl.gnome instead of icon.jl.gtk for example), since *.jl.gnome depends on rep-libgnome, rep-libgnomeui, rep-libgnomecanvas (part of rep-gtk) which depend on deprecated libs, I want to drop those files. Instead make the *.jl.gtk default, also remove the .gtk suffix, which is unnessacary then, if there's only one possibility. I want to drop libgnome/libgnomeui/libgnomecanvas from rep-gtk, but I first need to drop those files from sawfish.

Fix sawfish server connection

Alexey I. Froloff (ALT Linux)

Without this patch sawfish does not accept connections from sawfish-ui and sawfish-client with error:

$ sawfish-ui 
eval_req: Broken pipe
*** Remote sawfish error: unknown error

Broken by SVN revision 4275.

Warp-if-necessary when cycling

Christopher Bratusek

This will (if warp-to-window-enabled and cycle-raise-windows are t) warp the pointer to windows while cycling.

Since the former is disabled by default. It shouldn't make a difference for most people.

Warp-if-necessary when unmaximizing

Fernando Carmona Varo

This is a very simple patch but maybe a bit hard to make a decision about it too, since it's related to focus management and maybe changing the behavior could disturb someone accustomed to it.

It has not been much time since I started using the focus enter-only mode. And I've found it is a quite nice way to work. I like the fact that the mouse follows the focus when I change windows to prevent focus loss. However, sometimes when you unmaximize a window the focus is lost. If you were previously working on the maximized window you often won't be able to know where the focus will end up.. I think this is kind of uncomfortable.

I've added a "warp-if-necessary" at the end of the unmaximizing function. This will warp the mouse if it is out of the window and the "warp-to-window-enabled" option is enabled. However, I'm thinking that maybe some people accustomed to unmaximizing using the mouse might find uncomfortable to have the mouse warped when they click the maximized button, and yet they maybe still want enter-only focus and warping in the other cases. So, I'm thinking of maybe set a condition for the warping and only perform the action if the last-event was not a "Click" (by means of... (unless(string-match "Click" (event-name(last-event))) ...) However, as I normally maximize/unmaximize using the keyboard, I'm not sure if it would really be uncomfortable for such persons. So I'll just put here the patch and wait for your comments.

In the worst case, this could be easily made a script too, since there's a handy hook in there.

Re-expose smart placement modes

Christopher Bratusek

Add back the Smart placement modes "best-fit" "best-fit-group" and "first-fit-or-interactively" to the list of placement modes in SawfishUI

Slide-window-hook

Andrea Vettorello

This patch adds a new hook `before-slide-hook' which is called every time a window is moved using the keyboard. The code is executed before the actual move. I need an hook like this to fix stop-focus.jl mode, in particular it's used to update the mouse pointer position when moving windows with the keyboard. I've updated the documentation accordingly.


Re-expose extra placement modes

Andrea Vettorello

Brings back "stagger" and "off-center" placement modes.

A11y changes (Sawfish/Rep)

Shobbit Mathur

(Uploaded by Christopher Bratusek)

Sawfish-ui is not "accessible" currently.

Provide "atk" relation between widgets and corresponding labels.

There are two patches one for sawfish and one for rep-gtk.

Support NET WM USER TIME

Helmut Eller <eller.helmut at gmail.com>

This patch adds minimal support for the _NET_WM_USER_TIME hint. If this property is 0, Sawfish shouldn't give focus to the window when it is mapped. GTK uses this hint to implement gtk_window_set_focus_on_map.

The patch looks at the _NET_WM_USER_TIME and if it is zero, puts a the new property inhibit-focus-when-mapped on the window. It seemed to me, that inhibit-focus-when-mapped makes the intention clearer than comparing the timestamp with 0.

The map-notify-hook in transient.jl ignores windows if the property is set.


Fix Theme Installation

Christopher Bratusek / Michal Jaegermann

Fix mxflat theme installation, by installing themes as gzip'ed tarball. (Patch by Michal Jaegermann, update for applying against trunk by me)


Add error-handler both

Christopher Bratusek

Print errors both on the screen and the standard-error

Viewport boundary

Christopher Bratusek

This adds viewport-boundary (same as workspace-boundary, just for viewports)


Re-expose Keybindings

Christopher Bratusek

Brings back all "missing" keybindings to sawfish-ui


2 new button layouts for Crux

Christopher Bratusek

Patch to (finally) close #103520

Adds two new button layouts to Crux: Complete and Complete (Inverse)

Complete: close == shade iconify maximize menu Complete (Inverse): menu maximize iconify shade == close

Docu Update

Christopher Bratusek

Updated version of: http://mail.gnome.org/archives/sawfish-list/2008-September/msg00067.html

But this one also updates the header information (version, edition, mod-date, mod-month)


No more Control-l

Teika kazura

This patch removes Control-l (printed ^L in less, emacs, etc) in source files. The affected files are:

  • C-sources
  • lisp files
  • OPTIONS, TODO
  • po/sawfish-xgettext
  • scripts/sawfish-menu.jl
  • themes/Crux/theme.jl, themes/smaker/theme.jl

COPYING and themes/mxflat/GPL are omitted.

No other files contain them. (Of course excluding images and sounds.)

Pros Edit

  • Control-l annoys patch submitters.
  • Developpers who don't know what this Control-l is remain puzzled during their work.

I fall into both of these categories :).

Scroll viewport patch

Fernando Carmona Varo (script by Andreas Bombe)

This patch is based on Scrolling-viewport-switches script. It adds an option for switching viewports by moving a number of steps.

The original script does not work, as it needs viewport.jlc to be reloaded (and reloading it unsets the script changes). So I thought it would be better to make a patch for it to make it work, being integrated. I also modified it a bit for slightly better performance (previously it was doing 2 unneeded calls).

The maximum number of steps (slowest scroll) is set to 100. In my computer 100 is slow (well.. as intended) but works fine. However, it is maybe possible that older computers have problems, so maybe it's a good idea to test it and set a better number. The same can go for the default steps (5), I don't know if the feature would better be disabled by default (setting it to 1).


Honoring ICCCM aspect ratio

Andrea Vettorello

With this patch Sawfish honors aspect ratios when resizing a window interactively.

Maximize fullscreen xinerama

Jonathan Sambrook (Uploaded by Christopher Bratusek)

A hacky patch for maximizing windows fullscreen in the xinerama

Stacking-visibility

Timo Korvola

Fixes things to work better with the Composite extension.

Adds new functions window-obscured and stacking-visibility, which compute window visibility from the stacking order and do not rely on VisibilityNotify events. Modifies raise-lower and grow-pack to use these functions instead of window-visibility. VisibilityEvents appear unreliable when Composite is in use: every window is reported unobscured by window-visibility.

This patch is also available via Git from branch stacking-visibility at http://www.elisanet.fi/tkorvola/sawfish.git and you should pull it from there because Wiki may have messed with the formatting here.

Add Elberg-tabbed theme

Scott Scriven (ToyKeeper 00:13, 7 August 2008 (UTC))

Adds the Elberg-tabbed theme to themes/

Cycle-hook

Teika kazura

This patch adds a new hook `cycle-hook' which is called each time you cycle windows. The timing corresponds to the release of tab key in Windows.

I have updated the patch recently. Formerly it was a plain hook, but it is now a window hook. The manual is written too.

Add mxflat theme

Christopher Bratusek (Patch) tooar (Theme)

Add the mxflat theme. it's fast, highliy configurable and supports a lot of buttons. Ideal for daily use and as showcase. Scott said, he might add tab support to it.

Window prop list & prop del

Teika kazura and Timo Korvola

This patch defines two functions, `window-plist' and `window-prop-del'.

  • `window-plist' returns the property list of a window.
  • `window-prop-del' deletes a property of a window.

Both lack in the current sawfish.

The idea is suggested by Timo Korvola in the page of Focus policy improvement. The author thanks him.

Add get-S-tabbed theme

Scott Scriven (ToyKeeper 10:30, 5 August 2008 (UTC))

Adds the tabbed version of "get-S" into themes/.

Update desktop file (again)

Christopher Bratusek

Recent versions of gnome-window-properties don't run sawfish-ui, because of the out-dated desktop file.

This patch will also replace the capplet, which can then be safely removed from trunk.

For GNOME-Session 2.23 this desktop file is also used, to set the default window-manager, via the

/desktop/gnome/session/required-components/windowmanager

gconf-key, since some user might think {s,}he has to set the value to the binary-name, we should rename the file from "Sawfish.desktop" to "sawfish.desktop", for consistency and to avoid confusion.

L10n update

Christopher Bratusek

Update the pot file, the po files and remove deprecated strings.

Window menu item shortcuts

Fernando Carmona Varo and Guillermo S. Romero

The keyboard support for menu items is not very good in sawfish in my opinion, making menus kind of ankward to use if you are not using a mouse.

This patch activates some chars of the menu items to be used as shortcut keys.

for example, if you have Alt+Space as a key-binding to popup the menu, you will be able to maximize the window pressing "Alt-Space x" ...or make it be always on top pressing "Alt-Space i u". Kind of key chain shortcuts.

Also, the patch adds "Move" and "Resize" that were missing.

Keep Focus on move-window- direction ()

Mark Schreiber

(Uploaded by Christopher Bratusek)

taken from: http://bugzilla.gnome.org/show_bug.cgi?id=69520

Focus behaviour changed from 1.0 to 1.0.1-20020116:

The behavior used to be such that when I invoke the command move-window-<up, right, down, left>(), the window I move would always get the new focus on the viewports it got moved to.

The behavior in the new version of sawfish is such that the previously focused window on the viewport I move to gets the focus instead, and the window that I am moving loses focus (and seems to go to the back of the focus-stack).

This makes it difficult to move a single window across many viewports, since I might start out with a galeon in the upper-right -- but end up with an rxvt in the lower-left.

Remove .cvsignore files

Christopher Bratusek

We use SVN now. So no need for .cvsignore files.

Major C-Part Clean-Up

Christopher Bratusek

Major cleanup for Sawfish's c-part. Fixes most of the compiler-warnings and makes possible to build sawfish with CFLAGS="-Wall -ansi -pedantic" (previously: 68 (and build failed at fonts.c) / now: 9).

Ok building with CFLAGS="-Wall -ansi -pedantic" still fails, but this time it's not Sawfish's fault, it's the fault of two librep headers.

I'll therefore make clean-ups to librep and rep-gtk, too (not before 2 or 3 weeks, so be patient).

Decorations toolbar windows

Andrea Vettorello

I can't find in the EWMH specs how should be managed a window with _NET_WM_WINDOW_TYPE_TOOLBAR property enabled, but in this email http://mail.gnome.org/archives/wm-spec-list/2002-July/msg00002.html is stated that a toolbar should be decorated by the toolkit not the window manager.

Negative-property-p

Teika kazura

This patch improves the treatment of the boolean property of the window. It modifies the function `window-get', by adding an optional argument. It has no side effect (I mean the ordinary, not lisp side effect), not requiring any fix in existing codes.

The author thanks Tkorvola for the useful comment.

UsageEdit

(window-get window prop &optional checker)

The function `window-get' returns the value of the property PROP of WINDOW.

The current version of `window-get' returns nil either when the property value is nil, or the property is not set at all. There isn't a way to distinguish these two different situations.

In this patch, the function can take an optional argument CHECKER. If it is non-nil and PROP is unset, then it returns CHECKER.

NotesEdit

As a practical application of this patch, see my another patch focus policy improvement.

If this patch is to be accepted, then I would write the manual entry, too. The patch for the manual is now included. -Teika kazura 05:24, 25 June 2008 (UTC)

Thank you for reading.

Configure update

Christopher Bratusek

Bump version requirements: - pango 1.16 - gtk 2.6 - gdk 2.6

Also includes the version bump for sawfish to 1.3.4

Refresh icons

Timo Korvola

The Crux theme uses miniature versions of client icons in the window menu buttons. The scaled pixmaps are cached and are not updated if a client changes its icon. This patch fixes that.

You can also get this patch with Git from http://www.elisanet.fi/tkorvola/sawfish.git, branch icon-refresh.

Add POTFILES.in

Christopher Bratusek

Adds a POTFILE.in to make intltool-update work.

This patch is needed by my updated Fix make-pot patch.

Fix make-pot

Christopher Bratusek

Due to a wrong command the make-pot script is unable to update the pot file.

The updated version of this patch depends on this patch: Add POTFILES.in

Following patch fixes the issue.

Parallel make patch

Harald van Dijk

This patch fixes the parallel build bug that can result in:

(compiling sawfish/wm/commands/x-cycle.jl)
error--> (file-error "No such file or directory" "sawfish/wm/util/x")

When make is run with -j2 (or higher), it's possible that src/fake-libexec gets executed before the targets of the symbolic links it is supposed to create exist. src/.libexec will be incomplete if this happens, and make fails in lisp. This patch tells make to not run src/fake-libexec before the build is ready.

Update the Spec-file

Ian Dall

(Uploaded by Christopher Bratusek)

taken from: http://bugzilla.gnome.org/show_bug.cgi?id=520040

The Spec-file shipped with Sawfish is useless, since some keywords have changed.

This patch solves that issue.

Utf 8 names fix

Timo Korvola

Patch against 1.3.2. To illustrate the difference, run Sawfish in a non-UTF-8 locale but with a title font capable of displaying Unicode (I use Freemono), start a uxterm and gucharmap, then try xterm -T 'funny characters' and konsole -T 'funny characters', where the funny characters are not representable in the locale of Sawfish. With the Net_wm_names patch, only konsole gets its title rendered correctly but xterm does not. With the attached patch, both windows get correct titles.

See this post and this post

Titlebar updates

Harald van Dijk and Timo Korvola

When using a theme which updates itself as window titles change, such as the default theme Crux, the updates happen at the wrong time, and the title bar ends up messed up. When the netwm patch is applied, you can easily see this by normal browsing in Mozilla Firefox, or editing a document in editors that update the title to include "*" or "modified" when you start typing. This happens because the themes look for updates to the WM_NAME property, but sawfish now reads the _NET_WM_NAME property as well, so themes should check for updates to that too. This patch updates the default themes, and to prevent custom themes (not distributed with sawfish itself) from breaking, treats (call-after-property-changed 'WM_NAME ...) as a special case that should also check for _NEW_WM_NAME.

KDE tray fix 2

Timo Korvola

Another KDE system tray fix. The diff is against 1.3.2. The essential content is the one-line change in wm-spec.jl but I am bundling it with some other cleanups.

As of 3.5.8, KDE has still not completely replaced their old wm-dependent system tray protocol with the freedesktop.org one. They just kluged it: KDE apps continue to use the old protocol, but a kded module called kdetrayproxy tries to perform the part of the wm in that protocol and docks the tray icons using the freedesktop.org protocol.

It turned out that kdetrayproxy watches for new windows not by monitoring MapNotify events but by monitoring changes in the _NET_CLIENT_LIST root window property. Sawfish added windows to that list at a very early stage, before they had even been decorated. The result was kdetrayproxy being confused by the events caused by Sawfish decorating the window and Sawfish being confused by interference from kdetrayproxy. This patch delays the update of _NET_CLIENT_LIST to map-notify-hook. At that time the new window is already mapped (unless it starts iconic - map-notify-hook is executed even in that case).

This patch also fixes a potential problem of reparent-notify-hook getting called with a removed window. I have never seen anyone use that hook though. I also modified unmap_notify so that removal of WM_STATE is the very last action there. That property change indicates to the client that we are done processing the window withdrawal. The client may then reuse the window, e.g., remap it.

You can also get this patch with Git from http://www.elisanet.fi/tkorvola/sawfish.git, branch kde-tray-fix-2.

Multihead placed patch

Fuchur

This patch fix window placement with multihead setup. Look here

KDE menus focus

Harald van Dijk

Don't grab focus on KDE menus.

KDE system tray fix

Timo Korvola

Ignore out of bounds _NET_CURRENT_DESKTOP requests silently.

KDE system tray apps have a nasty habit of sending _NET_CURRENT_DESKTOP client messages with a parameter of -1, which confuses Sawfish. This patch adds some bounds checking.

Net wm properties

Rodrigo Gallardo <rodrigo@nul-unu.com>

This patch makes sawfish use the _NET_WM_NAME properties for window names, as mandated by the EWMH spec (http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html)

This patch is a bit more invasive that it seems requiered, because, to make it work properly in my system I had to make sawfish assume all strings are UTF8 encoded (see the pieces of the patch touching fonts.c)

Please test it and tell me what breaks. If there are no objections to the substance of the patch, I'd still like some feedback on what to do with text rendering with "normal" xlfd fonts.

Reparenting cleanup

Timo Korvola

This fixes reparenting fights that occur between Sawfish and the KDE system tray. Both try to reparent system tray icons as they are mapped, leading to a lot of flicker and an unpredictable end result. After the patch, Sawfish will reparent windows to their frames at MapRequest time, never at MapNotify. Also, windows that are unmapped by the client should normally be reparented to the root, but if the unmapping was caused by the window being reparented by some other client, problems ensue. So we check for that.

The patch also fixes an exotic race condition triggered at least with old versions of Monodevelop #308155 and Gnome Power Manager. Current versions of both programs don't expose the issue anymore. It was discussed on the mailing list on february 2007 and the follow up march 2007. There's a proof of concept available that should demonstrate the bug, a window isn't decorated if unmapped during the first reparenting.

Buffer overflow in fonts.c

Yoshiaki Kasahara

When I was trying to compile the source from svn on my FreeBSD box, I noticed one of port-local patches wasn't incorporated into the svn tree The following patch is for the stock 1.3 release, but it should be applied to the svn source, too.

ShapeInput in events.c

Michal Jaegermann

I tried to rebuild 1.3.1 on "CentOS release 4.5" installation and run into a minor problem that although a code in src/frames.c checks if 'ShapeInput' is available this is not the case in src/events.c. The following patch solves the issue:

Blank lines in prompt

Sven Schoenung

The window opened by the prompt function shows two blank lines before the prompt even when they aren't needed.

Noprop desktop save

Luis Rodrigo Gallardo Cruz

Sawfish saves the size of the desktop window, and although nautilus requests the widget to be the same size as your screen it's forced to the size that sawfish saved..

This patch is currently applied in the Debian package.

bugzilla bugreport

debian bugreport

Update desktop file

Rodrigo Gallardo

The current Sawfish.desktop file does not comply with the freedesktop.org standard.

Fix select workspace

GSR

Fixes select-workspace in lisp/sawfish/wm/workspace.jl to make sure it uses key params in its call to select-workspace*

This patch is currently applied in the Debian package.

debian: http://bugs.debian.org/413584

Fix Xlib client message

Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org>

This is a patch for Debian bug #406559, and possibly #403100, too. It seems these are ultimately caused by Xlib "helpfully" converting 32 bit messages from the server to the client's native long type, which is bad for sawfish since rep does distinguish these.

A longer description can be found in the patch's author's message in [2].

Rejected patches

PatchAuthorDescription

Smoother cursor moving

Fernando Carmona Varo

If you have ever tried to use the keyboard when moving/resizing windows (by means of the move-window-interactively command) and you have set a bigger mouse-cursor-increment value to move faster (what is a need if you have not a low resolution display). You probably noticed that the window is not responsive at all, and it doesn't move when the mouse cursor does move.

This patch is intended to fix that bug. If applied, windows will follow the mouse the way it should be.

UPDATE: I was asked by Christopher to write a smooth-warp-cursor function too. I think this could be a good idea to be used for other purposes in next patches. A version of the patch including this function is here, but let's first discuss this one (I'm not very sure of making a second patch for the same file, better wait for next revision).


Focus window without raise

Rüdiger Otte

This patch is rejected in 2008. You can see the patch and the discussion here.

What made the author suffer is that clicking raises windows. First make sure:

  • Open the configurator, choose "binding", and "window keymap". If "Button1-click" is bound to "raise-window-and-pass-through-click", then unbind it.
  • If you're window is raised by focusing, open the configurator "Focus" -> "auto raise". If that item isn't there, add (require 'sawfish.wm.ext.auto-raise) in your ~/.sawfish/rc. Then uncheck the top item.

Some windows do raise even if you've done the above two. It's Sawfish bug, sorry, and you can avoid it by:

  • Open the configurator, choose "binding", and "window keymap". Assign "Button1-click" to "nop".

Display worskpace when cycling

Daniel M German (Updated by Teika kazura)

This patch adds 2 features that work in tandem:

1. display-wininfo displays the workspace in which the window lies. (if the display-wininfo-show-workspace variable is not nil)

2. the option to indicate if one should switch to a different workspace when cycling windows (like when using Alt-Tab). This option is enabled only if cycle-switch-workspaces is nil.

I have checked and only x-cycle uses display-wininfo, so this patch should have no side effects.

Update July 23, 10:31. I have updated the patch. If the variable cycle-show-window-names is nil (user wants no name of window displayed when cycling) AND cycle-switch-workspaces is nil (user does not want to momentarily switch workspaces) then the title of the window is displayed (otherwise there is no visual clue).

Alpha backgrounds

Philip Langdale

Make window to draw properly with transparent pieces.

So, I've been playing around with the new gnome-terminal with true transparency and it's provoked me to fix the problem where ARGB windows end up with transparent frame elements. This occurs because gdk_pixbuf_xlib actively clobbers the alpha channel when rendering into Drawables. As it's easier to fix sawfish than to get a gtk patch in, I've come up with this change that ensures the alpha value is 0xFF (fully opaque) when drawing the frame elements. It's a little sad because we have to replace XCopyArea with a client side operation (XGet/PutImage) but frame elements are usually very small so this shouldn't hurt too badly.

Stacking compliance

Christian Marillat

Change default stacking depth for docks.

Make fullscreen windows have a higher stacking depth than normal.

Libglade2 xgettext make.pot

Yoshiaki Kasahara

There is no libglade-xgettext in libglade-2.x. How can I fix po/make-pot ? It seems that xgettext program can directly parse Glade input files. I have no knowledge how these things work, but how about the following patch?

Submitted patches

PatchAuthorDescription

Focus grabs aren't focus changes

Harald van Dijk

When a window grabs focus, sawfish doesn't treat it as a "focus out" of the old window, but does treat it as a "focus in" of the new one. This causes problems with Global Menu Bar for GNOME: when opening a menu, the menu grabs keyboard input. In sawfish, as a result, the GNOME top panel (or wherever you have placed the menu) becomes focused, and the menu bar is updated to reflect that no application window has focus. In short, the menu bar is completely unusable. The patch made focus_in ignore the same events that focus_out already ignores, but was updated after comments on the mailing list to only affect the _NET_ACTIVE_WINDOW property so that all other focus-related functions (including updating the window frame) get called, and to update mode_to_sym to handle NotifyWhileGrabbed events.

Note that even with this patch, it is necessary to force the GNOME panel to "never focus". The panel is focusable in sawfish and fluxbox, which causes the same problem even without opening menus, but that is not a bug in the window manager, and easily worked around using for example Window Rules from the Sawfish Configurator.

Empty error handler()

Janek Kozicki

See related patch Xinerama and X ConfigureWindow fix, and ML short discussion: [3].

After some testing I can say that error_handler() isn't necessary at all. I don't know Xlib good enough to know how to remove it, so, I just propose to make it empty.


Category:In experimental

Suspended patches

PatchAuthorDescription

Improved extensibility for window-order

Martin Stjernholm, uploaded by Christopher Bratusek, adaptation by Teika kazura.

Current sawfish maintains window stacking order by MRU, or more-recently-used, and there's no way to define other stacking order. The stacking order is used in window-cycling (which corresponds to Alt-tab in Microsoft Windows.) Cycling is implemented in wm/commands/x-cycle.jl, and basically it does not depend on the specific way of stacking order.

Martin Stjernholm submitted this patch in 2004 which enables to register other window stacking order, and therein MRU is an implementation of stacking order. This API is provided in wm/util/window-order.jl where the original MRU is defined.

The patch was rejected by the maintainer of sawfish. So Stjernholm didn't use this patch for his own use. Instead, he rewrote x-cycle.jl to meet his purpose where stacking is based on window position, not MRU.

I, Teika kazura, thank Stjernholm who kindly answered my questions on this patch.

See also Tiling placement by the same author.

Original appearance Edit

Originally appeared at http://mail.gnome.org/archives/sawfish-list/2004-February/msg00000.html , and replies can be found at http://mail.gnome.org/archives/sawfish-list/2004-March/msg00007.html . The author hasn't modified it since, because it was rejected.

It is also submitted to http://bugzilla.gnome.org/show_bug.cgi?id=137772 .

Details Edit

  • Autoload is not used. (The author didn't know how to do it.)
  • Some changes in x-cycle.jl is necessary because it assumes MRU. This is also realized by splitting the function into 'get-windows-to-order' and sort-windows-in-order. To quote the author:
    "One that gets the window list to order (get-windows-to-order) and another one that does the actual sorting (sort-windows-in-order)."
  • Bug fix for warp-pointer-if-necessary; fix is already taken for 1.5.0, but I leave Stjernholm's comment on it:
    "A little bit of refactoring between that code and activate-window in windows.jl is probably in order to avoid this kind of bug in the future."

13 mouse buttons

Jeremy Bryan Smith

I have a "Kensington Expert Mouse Pro" USB trackball device, which in addition to 4 regular mouse buttons, mouse wheel up/down and mouse wheel button, has 6 "extra" buttons (for a grand total of 13).

In the past, X did not seem to support those extra buttons and so I was using a separate program I wrote to configure the buttons, but after upgrading to Xorg 7.1, I noticed that xev was registering those extra buttons. So I quickly opened Sawfish Configurator to set them up. Unfortunately, Sawfish could only recognize 9 buttons. I was able to modify the source so that Sawfish recognizes these buttons (see attachment), but now I have another problem.

When I click on the root window, Sawfish recognizes the button clicks and performs my configured actions. However, if I click on any window other than the root with buttons 9, 11, 12, and 13, the window is given focus and my Sawfish command is not executed. I would expect it to act the same as the others: execute the programmed command and do not set focus to any window. All of my 6 "extra" buttons (8-13) are configured to switch to workspaces 1-6, respectively. Any ideas?

Focus-me-later

Teika kazura

This patch allows the new window not to be focused when it appeared, overriding the global option `focus-windows-when-mapped'.

DescriptionEdit

Let me remind you first that there's the global option `focus-windows-when-mapped', and the boolean window property `focus-when-mapped'. When a new window appears, will it be focused? Compare these situations:

  1. `focus-windows-when-mapped' is nil and `focus-when-mapped' is t. Then the window is focused. OK.
  2. `focus-windows-when-mapped' is t and `focus-when-mapped' is unset. Then the window is focused. OK.
  3. `focus-windows-when-mapped' is t and `focus-when-mapped' is set false. In fact, the window gets focused, despite of the window specific option. This seems quite unnatural; I expect that it is unfocused, and this patch allows it.

Let me summarize: if a boolean property is unset, nothing special is meant, the default. When set and is false, then it is stronger; a negation. At least I understand so.

BackgroundEdit

Why this is suspended, dispite of its usefulness?

It used to be unable for Sawfish to distinguish between an unset property and set with the value nil. So fixing only 'focus when mapped' field is a bit lopsided - not consistent with other options.

After raise/lower-window hooks

Fernando Carmona Varo <ferkiwi@gmail.com>

This adds two new window hooks: 'after-raise-window-hook' and 'after-lower-window-hook' which are called at the end of raise-window and lower-window respectively.

I've been looking at the code and I think all functions related to raise/lower to top/bottom depend on this two functions, so I think this is the right place for the hook.

It should be noted, however, that this hooks wont be called if the depth of the windows is modified slightly by other means (not really raising to the top nor lowering to the bottom). But I think this is ok, since raising and lowering are commands that trigger other operations (like changing the depth of transients/group) and this is consistent with it.

UPDATE: I've remade the patch properly (using svn diff), and added before- hooks (I think this are in fact better for other purpose).


Shade-focus

Andrew Sayers <ug55aes@cs.bham.ac.uk>

(Submitted by RodrigoGallardo from debian bug 144434.)

As an alteration to Sawfish's "shade-hover" mode, I've written a bit of code that shades and unshades a window when it gains and loses the focus. Hitting the "shade" button on a temporarily-unshaded window will set it to be permanently unshaded. It does this by exploiting the fact that a window's "shade" property has a slightly odd relationship with the actual shaded state of a window (which, if not deliberate, I'd like filed as a non-bug :).

I suspect Sawfish's "shade-hover" mode is used mostly by people who prefer the focus to be updated on window-enter and window-exit (I prefer window-enter only). If so, shade-focus can be seen as a generalisation of shade-hover, because they behave exactly the same with enter-exit focus switching.

The code isn't that aesthetically pleasing - I've been using the WM for less than a week, so I'm not fully up on the guts of the system yet :) It works, though. An interesting extension would be allow windows to individually choose between "shade-hover", "shade-focus" and "no auto-shading", but that kind of thing is way beyond my current abilities :)

Around Wikia's network

Random Wiki