61 |
|
|
62 |
|
|
63 |
|
// Constants |
64 |
< |
const char KEYCODE_FILE_NAME[] = SHAREDIR "/keycodes"; |
64 |
> |
const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes"; |
65 |
|
|
66 |
|
|
67 |
|
// Global variables |
142 |
|
// Set VideoMonitor according to video mode |
143 |
|
void set_video_monitor(int width, int height, int bytes_per_row, bool native_byte_order) |
144 |
|
{ |
145 |
< |
int layout; |
145 |
> |
int layout = FLAYOUT_DIRECT; |
146 |
|
switch (depth) { |
147 |
|
case 1: |
148 |
|
layout = FLAYOUT_DIRECT; |
204 |
|
wattr.event_mask = eventmask = win_eventmask; |
205 |
|
wattr.background_pixel = black_pixel; |
206 |
|
wattr.border_pixel = black_pixel; |
207 |
< |
wattr.backing_store = Always; |
208 |
< |
wattr.backing_planes = xdepth; |
207 |
> |
wattr.backing_store = NotUseful; |
208 |
|
|
209 |
|
XSync(x_display, false); |
210 |
|
the_win = XCreateWindow(x_display, rootwin, 0, 0, width, height, 0, xdepth, |
211 |
< |
InputOutput, vis, CWEventMask | CWBackPixel | CWBorderPixel | |
213 |
< |
CWBackingStore | CWBackingPlanes, &wattr); |
211 |
> |
InputOutput, vis, CWEventMask | CWBackPixel | CWBorderPixel | CWBackingStore, &wattr); |
212 |
|
XSync(x_display, false); |
213 |
|
XStoreName(x_display, the_win, GetString(STR_WINDOW_TITLE)); |
214 |
|
XMapRaised(x_display, the_win); |
468 |
|
|
469 |
|
#if ENABLE_DGA |
470 |
|
// DGA available? |
471 |
< |
int dga_flags = 0; |
472 |
< |
XF86DGAQueryDirectVideo(x_display, screen, &dga_flags); |
473 |
< |
has_dga = dga_flags & XF86DGADirectPresent; |
471 |
> |
int event_base, error_base; |
472 |
> |
if (XF86DGAQueryExtension(x_display, &event_base, &error_base)) { |
473 |
> |
int dga_flags = 0; |
474 |
> |
XF86DGAQueryDirectVideo(x_display, screen, &dga_flags); |
475 |
> |
has_dga = dga_flags & XF86DGADirectPresent; |
476 |
> |
} else |
477 |
> |
has_dga = false; |
478 |
|
#endif |
479 |
|
|
480 |
|
// Find black and white colors |