- mbind("4", MC_Titlebar, MouseClick, shade)
- mbind("5", MC_Titlebar, MouseClick, unshade)
-
- mbind("A-4", MC_Frame, MouseClick, next_desktop)
- mbind("A-4", MC_Root, MouseClick, next_desktop)
- mbind("A-5", MC_Frame, MouseClick, prev_desktop)
- mbind("A-5", MC_Root, MouseClick, prev_desktop)
+ mbind("Up", MC_Titlebar, MouseClick, shade)
+ mbind("Down", MC_Titlebar, MouseClick, unshade)
+
+ mbind("A-Up", MC_Frame, MouseClick, next_desktop)
+ mbind("A-Up", MC_Root, MouseClick, next_desktop)
+ mbind("A-Down", MC_Frame, MouseClick, prev_desktop)
+ mbind("A-Down", MC_Root, MouseClick, prev_desktop)
+
+ mbind("C-A-Up", MC_Frame, MouseClick, send_to_next_desktop)
+ mbind("C-A-Down", MC_Frame, MouseClick, send_to_prev_desktop)
+
+def setup_fallback_focus():
+ """Sets up a focus fallback routine so that when no windows are focused,
+ the last window to have focus on the desktop will be focused."""
+ global ob_focus_fallback # see focus.py
+ ob_focus_fallback = 1
+
+############################################################################
+### Window placement algorithms, choose one of these and ebind it to the ###
+### EventPlaceWindow action. ###
+############################################################################
+
+ob_rand = None
+import random
+def placewindows_random(data):
+ if not data.client: return
+ client_area = data.client.area()
+ frame_size = data.client.frame.size()
+ screen = display.screenInfo(data.screen)
+ width = screen.width() - (client_area.width() +
+ frame_size.left + frame_size.right)
+ height = screen.height() - (client_area.height() +
+ frame_size.top + frame_size.bottom)
+ global ob_rand
+ if not ob_rand: ob_rand = random.Random()
+ x = ob_rand.randrange(0, width-1)
+ y = ob_rand.randrange(0, height-1)
+ data.client.move(x, y)