diff options
author | Matthew Allum <breakfast@10.am> | 2005-06-09 16:22:27 +0000 |
---|---|---|
committer | Matthew Allum <breakfast@10.am> | 2005-06-09 16:22:27 +0000 |
commit | 92b3775ae8bdd4a84d7e101b36b306fbd3ac17a2 (patch) | |
tree | 6a21a2aaefe831939708128305b86ed1c86904d1 | |
parent | 545c082cf9c86f2a809ea6b4dca33643afb0c3d3 (diff) |
TSLib fixes. Add fullscreen support to ephyr
-rw-r--r-- | hw/kdrive/ephyr/ephyr.c | 3 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyrinit.c | 6 | ||||
-rw-r--r-- | hw/kdrive/ephyr/hostx.c | 46 | ||||
-rw-r--r-- | hw/kdrive/ephyr/hostx.h | 6 | ||||
-rw-r--r-- | hw/kdrive/epson/epson13806stub.c | 2 | ||||
-rw-r--r-- | hw/kdrive/linux/tslib.c | 2 |
6 files changed, 61 insertions, 4 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 2663728ae..95670eb24 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -355,7 +355,8 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) *rotations = RR_Rotate_All|RR_Reflect_All; - if (!hostx_want_preexisting_window()) /* only if no -parent switch */ + if (!hostx_want_preexisting_window() + && !hostx_want_fullscreen()) /* only if no -parent switch */ { while (sizes[n].width != 0 && sizes[n].height != 0) { diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 45df309f0..2bb3d0b0c 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -61,6 +61,7 @@ ddxUseMsg (void) ErrorF("\nXephyr Option Usage:\n"); ErrorF("-parent XID Use existing window as Xephyr root win\n"); ErrorF("-host-cursor Re-use exisiting X host server cursor\n"); + ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n"); ErrorF("\n"); exit(1); @@ -87,6 +88,11 @@ ddxProcessArgument (int argc, char **argv, int i) hostx_use_host_cursor(); return 1; } + else if (!strcmp (argv[i], "-fullscreen")) + { + hostx_use_fullscreen(); + return 1; + } else if (argv[i][0] == ':') { hostx_set_display_name(argv[i]); diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index f3f961ec6..2e1ef51af 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -61,7 +61,9 @@ struct EphyrHostXVars XImage *ximg; int win_width, win_height; Bool use_host_cursor; + Bool use_fullscreen; Bool have_shm; + long damage_debug_msec; unsigned char *fb_data; /* only used when host bpp != server bpp */ @@ -71,7 +73,7 @@ struct EphyrHostXVars }; /* memset ( missing> ) instead of below */ -static EphyrHostXVars HostX = { "?", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +static EphyrHostXVars HostX = { "?", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; static int HostXWantDamageDebug = 0; @@ -85,6 +87,9 @@ extern int kdMaxKeyCode; extern int kdKeymapWidth; extern int monitorResolution; +static void +hostx_set_fullscreen_hint(void); + /* X Error traps */ static int trapped_error_code = 0; @@ -118,7 +123,8 @@ hostx_errors_untrap(void) int hostx_want_screen_size(int *width, int *height) { - if (HostX.win_pre_existing != None) + if (HostX.win_pre_existing != None + || HostX.use_fullscreen == True) { *width = HostX.win_width; *height = HostX.win_height; @@ -168,6 +174,34 @@ hostx_want_preexisting_window(void) } void +hostx_use_fullscreen(void) +{ + HostX.use_fullscreen = True; +} + +int +hostx_want_fullscreen(void) +{ + return HostX.use_fullscreen; +} + +static void +hostx_set_fullscreen_hint(void) +{ + Atom atom_WINDOW_STATE, atom_WINDOW_STATE_FULLSCREEN; + + atom_WINDOW_STATE + = XInternAtom(HostX.dpy, "_NET_WM_STATE", False); + atom_WINDOW_STATE_FULLSCREEN + = XInternAtom(HostX.dpy, "_NET_WM_STATE_FULLSCREEN",False); + + XChangeProperty(HostX.dpy, HostX.win, + atom_WINDOW_STATE, XA_ATOM, 32, + PropModeReplace, + (unsigned char *)&atom_WINDOW_STATE_FULLSCREEN, 1); +} + +void hostx_use_preexisting_window(unsigned long win_id) { HostX.win_pre_existing = win_id; @@ -264,6 +298,14 @@ hostx_init(void) &attr); hostx_set_win_title("( ctrl+shift grabs mouse and keyboard )"); + + if (HostX.use_fullscreen) + { + HostX.win_width = DisplayWidth(HostX.dpy, HostX.screen); + HostX.win_height = DisplayHeight(HostX.dpy, HostX.screen); + + hostx_set_fullscreen_hint(); + } } diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h index a27e4bea9..73e7e04a1 100644 --- a/hw/kdrive/ephyr/hostx.h +++ b/hw/kdrive/ephyr/hostx.h @@ -88,6 +88,12 @@ hostx_want_host_cursor(void); void hostx_use_host_cursor(void); +void +hostx_use_fullscreen(void); + +int +hostx_want_fullscreen(void); + int hostx_want_preexisting_window(void); diff --git a/hw/kdrive/epson/epson13806stub.c b/hw/kdrive/epson/epson13806stub.c index 74676d54a..35db3e44a 100644 --- a/hw/kdrive/epson/epson13806stub.c +++ b/hw/kdrive/epson/epson13806stub.c @@ -55,7 +55,7 @@ InitInput (int argc, char **argv) { KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs); #ifdef TOUCHSCREEN - KdInitTouchScreen (&TsFuncs); + KdAddMouseDriver (&TsFuncs); #endif } diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c index 25474a867..eafba56b0 100644 --- a/hw/kdrive/linux/tslib.c +++ b/hw/kdrive/linux/tslib.c @@ -171,6 +171,8 @@ TslibInit (void) if (!TsInputType) TsInputType = KdAllocInputType (); + KdMouseInfoAdd(); /* allocate empty kdMouseInfo entry for ts */ + for (mi = kdMouseInfo; mi; mi = next) { next = mi->next; |