blob: 951353e6a002706b8c2a2fd1621bb1932920c565 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#include "ocm.h"
bool
ocm_window_owns_xwindow (ocm_window_t *window, Window xwindow)
{
if (window->xwindow == xwindow)
return TRUE;
return FALSE;
}
ocm_window_t *
ocm_window_new (ocm_app_t *app, Window xwindow)
{
ocm_window_t *owindow = ocm_malloc (sizeof *owindow);
XWindowAttributes attrs;
XGrabServer (app->display);
ocm_begin_ignore_errors (app);
if (!XGetWindowAttributes (app->display, xwindow, &attrs))
{
owindow = NULL;
goto out;
}
owindow->app = app;
owindow->xwindow = xwindow;
owindow->damage = XDamageCreate (
app->display, owindow->xwindow, XDamageReportNonEmpty);
out:
ocm_end_ignore_errors (app);
XUngrabServer (app->display);
return owindow;
}
void
ocm_window_free (ocm_window_t *window)
{
ocm_free (window);
}
|