mcwm
Michael Cardell Widerkrantz
November 11, 2011 History of mcwm
Desktop Environments
Floating or Tiling mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information Outline
History of mcwm
Desktop Environments
Floating or Tiling
mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information Why another window manager!? Window Managers I Have Known And Loved
TWM, CTWM, fvwm, 9wm, wm2, ratpoison and evilwm. Special mention: MGR Window System. tinywm / ∗ TinyWM is written by Nick Welch
# include
#define MAX(a, b) ((a) > (b) ? (a) : (b))
i n t main ( ) { Display ∗ dpy ; Window root; XWindowAttributes attr ; XButtonEvent start ; XEvent ev ;
if (!(dpy = XOpenDisplay(0x0))) return 1;
root = DefaultRootWindow(dpy);
XGrabKey(dpy, XKeysymToKeycode(dpy, XStringToKeysym(”F1”)) , Mod1Mask, root , True , GrabModeAsync, GrabModeAsync); XGrabButton(dpy, 1, Mod1Mask, root , True, ButtonPressMask , GrabModeAsync, GrabModeAsync, None, None); XGrabButton(dpy, 3, Mod1Mask, root , True, ButtonPressMask , GrabModeAsync, GrabModeAsync, None, None);
f o r ( ; ; ) { XNextEvent(dpy, &ev); if (ev.type == KeyPress && ev.xkey.subwindow != None) XRaiseWindow(dpy, ev.xkey.subwindow); else if (ev.type == ButtonPress && ev.xbutton.subwindow != None) { XGrabPointer(dpy, ev.xbutton.subwindow, True, PointerMotionMask | ButtonReleaseMask , GrabModeAsync, GrabModeAsync, None, None, CurrentTime ); XGetWindowAttributes(dpy, ev.xbutton.subwindow, &attr ); start = ev.xbutton; } else if(ev.type == MotionNotify) { int xdiff, ydiff; while(XCheckTypedEvent(dpy, MotionNotify , &ev)); xdiff = ev.xbutton.x r o o t − s t a r t . x r o o t ; ydiff = ev.xbutton.y r o o t − s t a r t . y r o o t ; XMoveResizeWindow(dpy, ev. xmotion .window, attr.x + (start.button==1 ? xdiff : 0), attr.y + (start.button==1 ? ydiff : 0), MAX(1, attr.width + (start.button==3 ? xdiff : 0)), MAX(1, attr.height + (start.button==3 ? ydiff : 0))); } else if (ev.type == ButtonRelease) XUngrabPointer(dpy, CurrentTime ); } } Outline
History of mcwm
Desktop Environments
Floating or Tiling
mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information Outline
History of mcwm
Desktop Environments
Floating or Tiling
mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information xmonad, a tiling wm, here on three screens TWM, a floating wm Outline
History of mcwm
Desktop Environments
Floating or Tiling
mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information mc 1663 6.7 1.6 67080 8744 pts/0 SNl 20:28 0:00 mc 1668 0.2 0.1 1864 708 pts/0 SN 20:29 0:00
Size Matters? Size Matters?
mc 1663 6.7 1.6 67080 8744 pts/0 SNl 20:28 0:00 mc 1668 0.2 0.1 1864 708 pts/0 SN 20:29 0:00 Outline
History of mcwm
Desktop Environments
Floating or Tiling
mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information Outline
History of mcwm
Desktop Environments
Floating or Tiling
mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information What does a window manager do?
I Subscribes to all window events and forwards them to the X server, possibly after changes.
I Reparents client windows. *
I Draws window decorations (title, buttons, borders et cetera) *
I Manage client hints (window title, workspace, fixed).
I Handles focus (following mouse, click, sloppy).
I Interacts with user through commands (mouse or special key presses). * Not mcwm. Outline
History of mcwm
Desktop Environments
Floating or Tiling
mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information mcwm with dzen Focus and window placement
mcwm has sloppy focus. New windows mapped on mouse pointer, fitted on the screen. Mouse buttons
Pressed together with Mod1 (usually Alt or Meta).
I Button 1 = move.
I Button 2 = raise/lower
I Button 3 = resize. Some key bindings
Pressed together with Mod4 (usually Super, the Windows key).
I h, j, k, l = moves window in vi fashion. Resizes with Shift pressed.
I x = maximize (toggles)
I , = move window to previous physical screen.
I Return = start terminal program of your choice.
I Tab = focus next window on this workspace. After releasing Mod4, a new Mod4 + Tab will bring you back to the window last focused.
I ... Too many to mention. See the manual. Outline
History of mcwm
Desktop Environments
Floating or Tiling
mcwm Features
XCB
What does a window manager do and how?
Using mcwm
Contact Information Contact
Michael Cardell Widerkrantz, [email protected] http://hack.org/mc/ mcwm: http://hack.org/mc/hacks/mcwm/