Subject: Add untimed autohiding (based on mouse presence) to pypanel
Package: pypanel
Version: 2.4-1.1
Severity: wishlist
Tags: patch

*** Please type your report below this line ***
Pypanel, as it is now has an autohiding feature, based on the time since the
last event received from the mouse.  This 
patch automatically hides the panel when the mouse leaves the pypanel window,
unfortunately disabling the timed 
autohiding.  

This patch has already been submitted upstream, though as 2.4 is the last
official version of pypanel, it seems 
unlikely that it will ever be included in the source.  Perhaps a future version
can combine both behaviors (i.e., start 
the auto-hide timer when the mouse leaves the pypanel window), as this would be
the expected behavior.  As it is, the 
panel is hidden immediately (exactly the behavior I want, but I'm not sure
about anybody else).

If I have time, I may work on a further patch to add this feature, but that'll
be in the future.

Thank you for your time,
Nick Daly

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-3-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages pypanel depends on:
ii  libc6                  2.7-6             GNU C Library: Shared libraries
ii  libfreetype6           2.3.5-1+b1        FreeType 2 font engine, shared lib
ii  libimlib2              1.4.0-1           powerful image loading and renderi
ii  libx11-6               2:1.0.3-7         X11 client-side library
ii  libxext6               1:1.0.3-2         X11 miscellaneous extension librar
ii  libxft2                2.1.12-2          FreeType-based font drawing librar
ii  python                 2.4.4-6           An interactive high-level object-o
ii  python-xlib            0.14-1            Interface for Python to the X11 Pr
ii  zlib1g                 1:1.2.3.3.dfsg-11 compression library - runtime

pypanel recommends no packages.

-- no debconf information


      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
--- pypanel	2008-02-06 20:10:39.000000000 -0500
+++ pypanel_autohide	2008-03-03 18:32:14.000000000 -0500
@@ -62,7 +62,7 @@
 		self.window = self.screen.root.create_window(P_START, P_LOCATION,
 			P_WIDTH, P_HEIGHT, 0, self.screen.root_depth, window_class=X.InputOutput,
 			visual=X.CopyFromParent, colormap=X.CopyFromParent, 
-			event_mask=(X.ExposureMask|X.ButtonPressMask|X.ButtonReleaseMask|X.EnterWindowMask))
+			event_mask=(X.ExposureMask|X.ButtonPressMask|X.ButtonReleaseMask|X.EnterWindowMask|X.LeaveWindowMask))
 		ppinit(self.window.id, FONT)
 		
 		# Init the panel sections
@@ -853,6 +852,11 @@
 					if e.window.id == win.id:
 						self.toggleHidden() 
 						self.updateTasks(dsp, root, win, panel)
+				elif e.type == X.LeaveNotify and not self.hidden:
+					if e.window.id == win.id:
+						# additional tests so it doesn't accidentally hide if we mouse over an icon
+						if (e.event_y < 0 or e.event_y > P_HEIGHT) or (e.event_x < 0 or e.event_x > P_WIDTH):
+							self.toggleHidden()
 				elif e.type == X.FocusIn:
 					prev_focus = self.focus
 					self.focus = e.window.id

Reply via email to