9 #warning Do something clever with xinerama
10 ObEdge *edge[OB_NUM_EDGES];
11 #warning put in config.c and parse configs of course
12 gboolean config_edge_enabled[OB_NUM_EDGES] = {1, 1, 1, 1, 1, 1, 1, 1};
16 #define CORNER_SIZE 20
21 static void get_position(ObEdgeLocation edge, Rect screen, Rect *rect)
25 RECT_SET(*rect, CORNER_SIZE, 0,
26 screen.width - 2 * CORNER_SIZE, EDGE_WIDTH);
28 case OB_EDGE_TOPRIGHT:
29 RECT_SET(*rect, screen.width - CORNER_SIZE, 0,
30 CORNER_SIZE, CORNER_SIZE);
33 RECT_SET(*rect, screen.width - EDGE_WIDTH, CORNER_SIZE,
34 EDGE_WIDTH, screen.height - 2 * CORNER_SIZE);
36 case OB_EDGE_BOTTOMRIGHT:
37 RECT_SET(*rect, screen.width - CORNER_SIZE,
38 screen.height - CORNER_SIZE,
39 CORNER_SIZE, CORNER_SIZE);
42 RECT_SET(*rect, CORNER_SIZE, screen.height - EDGE_WIDTH,
43 screen.width - 2 * CORNER_SIZE, EDGE_WIDTH);
45 case OB_EDGE_BOTTOMLEFT:
46 RECT_SET(*rect, 0, screen.height - CORNER_SIZE,
47 CORNER_SIZE, CORNER_SIZE);
50 RECT_SET(*rect, 0, CORNER_SIZE,
51 EDGE_WIDTH, screen.height - CORNER_SIZE);
54 RECT_SET(*rect, 0, 0, CORNER_SIZE, CORNER_SIZE);
59 void edges_startup(gboolean reconfigure)
63 XSetWindowAttributes xswa;
64 Rect *screen = screen_physical_area_all_monitors();
66 xswa.override_redirect = True;
68 for (i=0; i < OB_NUM_EDGES; i++) {
69 if (!config_edge_enabled[i])
72 edge[i] = g_new(ObEdge, 1);
73 edge[i]->obwin.type = OB_WINDOW_CLASS_INTERNAL;
75 get_position(i, *screen, &r);
76 edge[i]->win = XCreateWindow(obt_display, RootWindow(obt_display, ob_screen),
77 r.x, r.y, r.width, r.height, 0, 0, InputOnly,
78 CopyFromParent, CWOverrideRedirect, &xswa);
79 XMapWindow(obt_display, edge[i]->win);
81 stacking_add(INTERNAL_AS_WINDOW(edge[i]));
82 window_add(&edge[i]->win, INTERNAL_AS_WINDOW(edge[i]));
85 printf("mapped edge window %i at %03i %03i %02i %02i\n", i, r.x, r.y, r.width, r.height);
95 void edges_shutdown(gboolean reconfigure)
99 for (i=0; i < OB_NUM_EDGES; i++) {
100 window_remove(edge[i]->win);
101 stacking_remove(INTERNAL_AS_WINDOW(edge[i]));
102 XDestroyWindow(obt_display, edge[i]->win);