42 |
static Screen *g_screen; |
static Screen *g_screen; |
43 |
Window g_wnd; |
Window g_wnd; |
44 |
BOOL g_enable_compose = False; |
BOOL g_enable_compose = False; |
45 |
static GC g_gc; |
static GC g_gc = NULL; |
|
static BOOL g_gc_initialized = False; |
|
46 |
static Visual *g_visual; |
static Visual *g_visual; |
47 |
static int g_depth; |
static int g_depth; |
48 |
static int g_bpp; |
static int g_bpp; |
50 |
static XIC g_IC; |
static XIC g_IC; |
51 |
static XModifierKeymap *g_mod_map; |
static XModifierKeymap *g_mod_map; |
52 |
static Cursor g_current_cursor; |
static Cursor g_current_cursor; |
53 |
static HCURSOR g_null_cursor; |
static HCURSOR g_null_cursor = NULL; |
54 |
static Atom g_protocol_atom, g_kill_atom; |
static Atom g_protocol_atom, g_kill_atom; |
55 |
static BOOL g_focused; |
static BOOL g_focused; |
56 |
static BOOL g_mouse_in_wnd; |
static BOOL g_mouse_in_wnd; |
63 |
|
|
64 |
/* software backing store */ |
/* software backing store */ |
65 |
static BOOL g_ownbackstore; |
static BOOL g_ownbackstore; |
66 |
static Pixmap g_backstore; |
static Pixmap g_backstore = NULL; |
|
static BOOL g_backstore_initialized = False; |
|
67 |
|
|
68 |
/* Moving in single app mode */ |
/* Moving in single app mode */ |
69 |
static BOOL g_moving_wnd; |
static BOOL g_moving_wnd; |
849 |
{ |
{ |
850 |
if (g_IM != NULL) |
if (g_IM != NULL) |
851 |
XCloseIM(g_IM); |
XCloseIM(g_IM); |
852 |
|
|
853 |
|
if (g_null_cursor != NULL) |
854 |
|
ui_destroy_cursor(g_null_cursor); |
855 |
|
|
856 |
XFreeModifiermap(g_mod_map); |
XFreeModifiermap(g_mod_map); |
857 |
|
|
889 |
CWBackPixel | CWBackingStore | CWOverrideRedirect | |
CWBackPixel | CWBackingStore | CWOverrideRedirect | |
890 |
CWColormap | CWBorderPixel, &attribs); |
CWColormap | CWBorderPixel, &attribs); |
891 |
|
|
892 |
if ( ! g_gc_initialized ) |
if (g_gc == NULL) |
|
{ |
|
893 |
g_gc = XCreateGC(g_display, g_wnd, 0, NULL); |
g_gc = XCreateGC(g_display, g_wnd, 0, NULL); |
|
g_gc_initialized = True; |
|
|
} |
|
894 |
|
|
895 |
if ((g_ownbackstore) && (! g_backstore_initialized)) |
if ((g_ownbackstore) && (g_backstore == NULL)) |
896 |
{ |
{ |
897 |
g_backstore = |
g_backstore = |
898 |
XCreatePixmap(g_display, g_wnd, g_width, g_height, |
XCreatePixmap(g_display, g_wnd, g_width, g_height, |
901 |
/* clear to prevent rubbish being exposed at startup */ |
/* clear to prevent rubbish being exposed at startup */ |
902 |
XSetForeground(g_display, g_gc, BlackPixelOfScreen(g_screen)); |
XSetForeground(g_display, g_gc, BlackPixelOfScreen(g_screen)); |
903 |
XFillRectangle(g_display, g_backstore, g_gc, 0, 0, g_width, g_height); |
XFillRectangle(g_display, g_backstore, g_gc, 0, 0, g_width, g_height); |
|
g_backstore_initialized = True; |
|
904 |
} |
} |
905 |
|
|
906 |
XStoreName(g_display, g_wnd, g_title); |
XStoreName(g_display, g_wnd, g_title); |
967 |
XSetWMProtocols(g_display, g_wnd, &g_kill_atom, 1); |
XSetWMProtocols(g_display, g_wnd, &g_kill_atom, 1); |
968 |
|
|
969 |
/* create invisible 1x1 cursor to be used as null cursor */ |
/* create invisible 1x1 cursor to be used as null cursor */ |
970 |
g_null_cursor = ui_create_cursor(0, 0, 1, 1, null_pointer_mask, null_pointer_data); |
if (g_null_cursor == NULL) |
971 |
|
g_null_cursor = ui_create_cursor(0, 0, 1, 1, null_pointer_mask, null_pointer_data); |
972 |
|
|
973 |
return True; |
return True; |
974 |
} |
} |