Wikia

Sawfish

KDE system tray fix

773pages on
this wiki
Talk0
Browse all patches

Author Edit

Timo Korvola

Synopsis Edit

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.

Patch Edit

--- a/lisp/sawfish/wm/state/wm-spec.jl
+++ b/lisp/sawfish/wm/state/wm-spec.jl
@@ -519,7 +519,12 @@
         (set-viewport (aref data 0) (aref data 1)))
 
        ((_NET_CURRENT_DESKTOP)
-        (select-workspace (workspace-id-from-logical (aref data 0))))
+         ; KDE spews _NET_CURRENT_DESKTOP( -1) messages so often that it
+         ; is best to just ignore out of bounds errors silently.
+         (let ((ws (workspace-id-from-logical (aref data 0)))
+               (limits (workspace-limits)))
+           (if (<= (car limits) ws (cdr limits))
+               (select-workspace ws))))
 
        ((_NET_DESKTOP_NAMES)
         ;; XXX this is kind of broken now we use workspace-names to

Community's reasons for inclusion or rejection Edit

  • Yes vote: yes. Although it is KDE that is misbehaving here, a little bounds checking should not hurt. - Tkorvola 13:18, 2 December 2007 (UTC)
  • This bug seems similar to the problems in [Fix_Xlib_client_message] If that is really the case, and applying that patch were to solve this issue, I'd rather not apply this patch, since it will hide bugs in other apps. RodrigoGallardo 15:09, 16 January 2008 (UTC)
  • The problem addressed by the other patch is specific to 64-bit platforms, whereas the one addressed here is not. In any case, bounds checking is the reasonable thing to do here. I suppose it would be possible to display an error message but most users would probably not want to see it. EWMH does not specify what to do with out of bounds _NET_CURRENT_DESKTOP messages. Because the number of desktops may change, out of bounds errors are in principle possible even with well-behaving clients. Tkorvola 19:59, 16 January 2008 (UTC)
  • Yes vote: yes. bounds checking will never hurt so I'm applying it, thanks. Janek Kozicki 12:34, 19 January 2008 (UTC)

Around Wikia's network

Random Wiki