TSLib fixes. Add fullscreen support to ephyr

This commit is contained in:
Matthew Allum 2005-06-09 16:22:27 +00:00
parent 545c082cf9
commit 92b3775ae8
6 changed files with 61 additions and 4 deletions

View File

@ -355,7 +355,8 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
*rotations = RR_Rotate_All|RR_Reflect_All; *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) while (sizes[n].width != 0 && sizes[n].height != 0)
{ {

View File

@ -61,6 +61,7 @@ ddxUseMsg (void)
ErrorF("\nXephyr Option Usage:\n"); ErrorF("\nXephyr Option Usage:\n");
ErrorF("-parent XID Use existing window as Xephyr root win\n"); ErrorF("-parent XID Use existing window as Xephyr root win\n");
ErrorF("-host-cursor Re-use exisiting X host server cursor\n"); ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("\n"); ErrorF("\n");
exit(1); exit(1);
@ -87,6 +88,11 @@ ddxProcessArgument (int argc, char **argv, int i)
hostx_use_host_cursor(); hostx_use_host_cursor();
return 1; return 1;
} }
else if (!strcmp (argv[i], "-fullscreen"))
{
hostx_use_fullscreen();
return 1;
}
else if (argv[i][0] == ':') else if (argv[i][0] == ':')
{ {
hostx_set_display_name(argv[i]); hostx_set_display_name(argv[i]);

View File

@ -61,7 +61,9 @@ struct EphyrHostXVars
XImage *ximg; XImage *ximg;
int win_width, win_height; int win_width, win_height;
Bool use_host_cursor; Bool use_host_cursor;
Bool use_fullscreen;
Bool have_shm; Bool have_shm;
long damage_debug_msec; long damage_debug_msec;
unsigned char *fb_data; /* only used when host bpp != server bpp */ unsigned char *fb_data; /* only used when host bpp != server bpp */
@ -71,7 +73,7 @@ struct EphyrHostXVars
}; };
/* memset ( missing> ) instead of below */ /* 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; static int HostXWantDamageDebug = 0;
@ -85,6 +87,9 @@ extern int kdMaxKeyCode;
extern int kdKeymapWidth; extern int kdKeymapWidth;
extern int monitorResolution; extern int monitorResolution;
static void
hostx_set_fullscreen_hint(void);
/* X Error traps */ /* X Error traps */
static int trapped_error_code = 0; static int trapped_error_code = 0;
@ -118,7 +123,8 @@ hostx_errors_untrap(void)
int int
hostx_want_screen_size(int *width, int *height) 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; *width = HostX.win_width;
*height = HostX.win_height; *height = HostX.win_height;
@ -167,6 +173,34 @@ hostx_want_preexisting_window(void)
return 0; return 0;
} }
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 void
hostx_use_preexisting_window(unsigned long win_id) hostx_use_preexisting_window(unsigned long win_id)
{ {
@ -264,6 +298,14 @@ hostx_init(void)
&attr); &attr);
hostx_set_win_title("( ctrl+shift grabs mouse and keyboard )"); 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();
}
} }

View File

@ -88,6 +88,12 @@ hostx_want_host_cursor(void);
void void
hostx_use_host_cursor(void); hostx_use_host_cursor(void);
void
hostx_use_fullscreen(void);
int
hostx_want_fullscreen(void);
int int
hostx_want_preexisting_window(void); hostx_want_preexisting_window(void);

View File

@ -55,7 +55,7 @@ InitInput (int argc, char **argv)
{ {
KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs); KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
#ifdef TOUCHSCREEN #ifdef TOUCHSCREEN
KdInitTouchScreen (&TsFuncs); KdAddMouseDriver (&TsFuncs);
#endif #endif
} }

View File

@ -171,6 +171,8 @@ TslibInit (void)
if (!TsInputType) if (!TsInputType)
TsInputType = KdAllocInputType (); TsInputType = KdAllocInputType ();
KdMouseInfoAdd(); /* allocate empty kdMouseInfo entry for ts */
for (mi = kdMouseInfo; mi; mi = next) for (mi = kdMouseInfo; mi; mi = next)
{ {
next = mi->next; next = mi->next;