Changeset e5a49d88871fb35f6707a45ab64035954decd2ad for samurai-x
- Timestamp:
- 08/01/2008 03:44:22 PM (2 years ago)
- Children:
- 8cb29f0449b55f9722acde17e3cf24cf1c7e501e
- Parents:
- 4ade186470c310d77434411f4fab27ab8ccfc5a0
- git-committer:
- dunkfordyce <dunkfordyce@561c22c7-a851-0410-91f3-c76db74392ff> / 2008-08-01T14:44:22Z+0000
- Location:
- samurai-x/samuraix
- Files:
-
- 2 modified
-
client.py (modified) (4 diffs)
-
defaultconfig.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
samurai-x/samuraix/client.py
r4ade18 re5a49d 398 398 root = xlib.XRootWindow(samuraix.display, self.screen.num) 399 399 400 400 401 if (xlib.XGrabPointer(samuraix.display, 401 402 root, … … 405 406 return 406 407 408 if not xlib.XGrabServer(samuraix.display): 409 log.warn('possibly failed grabbing server') 410 411 gc = xlib.XCreateGC(samuraix.display, self.window, 0, None) 412 xlib.XSetForeground(samuraix.display, gc, self.screen.white_pixel) 413 xlib.XSetFunction(samuraix.display, gc, xlib.GXxor) 414 xlib.XSetSubwindowMode(samuraix.display, gc, xlib.IncludeInferiors) 415 #xlib.XSetBackground(samuraix.display, gc, self.screen.white_pixel) 416 407 417 xlib.XWarpPointer(samuraix.display, xlib.None_, self.window, 0, 0, 0, 0, 408 418 self.geom.width + self.border_width - 1, self.geom.height + self.border_width - 1) … … 412 422 geom = self.geom.copy() 413 423 424 xlib.XDrawRectangle(samuraix.display, root, gc, 425 geom.x, geom.y, geom.width, geom.height) 426 xlib.XFlush(samuraix.display) 427 xlib.XSync(samuraix.display, 0) 428 429 ev = xlib.XEvent() 430 414 431 while True: 415 432 416 xlib.XMaskEvent(samuraix.display, 417 MOUSEMASK | xlib.ExposureMask | xlib.SubstructureRedirectMask, 418 byref(ev)) 433 xlib.XNextEvent(samuraix.display, byref(ev)) 434 435 #xlib.XMaskEvent(samuraix.display, 436 # MOUSEMASK | xlib.ExposureMask | xlib.SubstructureRedirectMask, 437 # byref(ev)) 419 438 420 439 if ev.type == xlib.ButtonRelease: … … 422 441 break 423 442 elif ev.type == xlib.MotionNotify: 443 # erase the old box 444 xlib.XDrawRectangle(samuraix.display, root, gc, 445 geom.x, geom.y, geom.width, geom.height) 446 424 447 geom.width = max(0, ev.xmotion.x - ocx - 2 * self.border_width + 1) 425 448 geom.height = max(0, ev.xmotion.y - ocy - 2 * self.border_width + 1) 426 self.resize(geom) 449 450 xlib.XDrawRectangle(samuraix.display, root, gc, 451 geom.x, geom.y, geom.width, geom.height) 452 xlib.XFlush(samuraix.display) 453 xlib.XSync(samuraix.display, 0) 427 454 else: 428 455 samuraix.app.handle_event(ev) 429 456 457 # erase the box 458 xlib.XDrawRectangle(samuraix.display, root, gc, 459 geom.x, geom.y, geom.width, geom.height) 460 xlib.XFlush(samuraix.display) 461 xlib.XSync(samuraix.display, 0) 462 463 xlib.XUngrabServer(samuraix.display) 464 xlib.XFreeGC(samuraix.display, gc) 465 466 self.resize(geom) 430 467 self.floating_geom = self.geom.copy() 431 468 self.resizing = False -
samurai-x/samuraix/defaultconfig.py
rb5c412 re5a49d 6 6 from samuraix.userfuncs import * 7 7 8 default_mod = xlib.Mod4Mask 8 9 9 10 config = { … … 32 33 33 34 'keys': { 34 (keysymdef.XK_Return, xlib.Mod4Mask):35 (keysymdef.XK_Return, default_mod): 35 36 spawn("xterm"), 36 (keysymdef.XK_g, xlib.Mod4Mask):37 (keysymdef.XK_g, default_mod): 37 38 spawn("gimp"), 38 39 39 (keysymdef.XK_F2, xlib.Mod4Mask):40 spawn("./s amurai-runner"),40 (keysymdef.XK_F2, default_mod): 41 spawn("./sx-runner"), 41 42 42 (keysymdef.XK_Page_Up, xlib.Mod4Mask):43 (keysymdef.XK_Page_Up, default_mod): 43 44 spawn("amixer -c 0 set Master 2dB+"), 44 (keysymdef.XK_Page_Down, xlib.Mod4Mask):45 (keysymdef.XK_Page_Down, default_mod): 45 46 spawn("amixer -c 0 set Master 2dB-"), 46 (keysymdef.XK_End, xlib.Mod4Mask):47 (keysymdef.XK_End, default_mod): 47 48 spawn("amixer -c 0 set Master 0dB+ toggle"), 48 49 49 (keysymdef.XK_l, xlib.Mod4Mask):50 (keysymdef.XK_l, default_mod): 50 51 spawn("xlock -mode biof"), 51 52 52 (keysymdef.XK_1, xlib.Mod4Mask):53 (keysymdef.XK_1, default_mod): 53 54 screenfunc('set_active_desktop_by_index', 0), 54 (keysymdef.XK_2, xlib.Mod4Mask):55 (keysymdef.XK_2, default_mod): 55 56 screenfunc('set_active_desktop_by_index', 1), 56 (keysymdef.XK_3, xlib.Mod4Mask):57 (keysymdef.XK_3, default_mod): 57 58 screenfunc('set_active_desktop_by_index', 2), 58 (keysymdef.XK_4, xlib.Mod4Mask):59 (keysymdef.XK_4, default_mod): 59 60 screenfunc('set_active_desktop_by_index', 3), 60 (keysymdef.XK_5, xlib.Mod4Mask):61 (keysymdef.XK_5, default_mod): 61 62 screenfunc('set_active_desktop_by_index', 4), 62 (keysymdef.XK_6, xlib.Mod4Mask):63 (keysymdef.XK_6, default_mod): 63 64 screenfunc('set_active_desktop_by_index', 5), 64 (keysymdef.XK_7, xlib.Mod4Mask):65 (keysymdef.XK_7, default_mod): 65 66 screenfunc('set_active_desktop_by_index', 6), 66 (keysymdef.XK_8, xlib.Mod4Mask):67 (keysymdef.XK_8, default_mod): 67 68 screenfunc('set_active_desktop_by_index', 7), 68 (keysymdef.XK_9, xlib.Mod4Mask):69 (keysymdef.XK_9, default_mod): 69 70 screenfunc('set_active_desktop_by_index', 8), 70 71 71 (keysymdef.XK_Right, xlib.Mod4Mask):72 (keysymdef.XK_Right, default_mod): 72 73 screenfunc('next_desktop'), 73 (keysymdef.XK_Left, xlib.Mod4Mask):74 (keysymdef.XK_Left, default_mod): 74 75 screenfunc('prev_desktop'), 75 76 76 (keysymdef.XK_m, xlib.Mod4Mask):77 (keysymdef.XK_m, default_mod): 77 78 focusedwindowfunc('toggle_maximise'), 78 79 }, … … 86 87 'client': { 87 88 'buttons': { 88 (1, xlib.Mod4Mask): clientfunc('mousemove'),89 (3, xlib.Mod4Mask): clientfunc('mouseresize'),89 (1, default_mod): clientfunc('mousemove'), 90 (3, default_mod): clientfunc('mouseresize'), 90 91 } 91 92 },
