JWM Source Documentation
outline.c
Go to the documentation of this file.
1 
10 #include "jwm.h"
11 #include "outline.h"
12 #include "main.h"
13 #include "grab.h"
14 
15 static GC outlineGC = None;
16 static int lastX, lastY;
17 static int lastWidth, lastHeight;
18 
20 void DrawOutline(int x, int y, int width, int height)
21 {
22  XGCValues gcValues;
23  gcValues.function = GXinvert;
24  gcValues.subwindow_mode = IncludeInferiors;
25  gcValues.line_width = 2;
27  GCFunction | GCSubwindowMode | GCLineWidth,
28  &gcValues);
29  GrabServer();
30  JXDrawRectangle(display, rootWindow, outlineGC, x, y, width, height);
31  lastX = x;
32  lastY = y;
33  lastWidth = width;
35 }
36 
38 void ClearOutline(void)
39 {
40  if(outlineGC != None) {
43  UngrabServer();
45  outlineGC = None;
46  }
47 }
48 

joewing.net / Projects / JWM