Commit 39b738a6 authored by Reinhard Tartler's avatar Reinhard Tartler

Imported nxagent-3.5.0-2.tar.gz

Summary: Imported nxagent-3.5.0-2.tar.gz Keywords: Imported nxagent-3.5.0-2.tar.gz into Git repository
parent e6db7e93
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -562,11 +562,15 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i],"fullscreen"))
{
nxagentChangeOption(Fullscreen, True);
nxagentChangeOption(AllScreens, True);
}
else if (!strcmp(argv[i],"ipaq"))
{
nxagentChangeOption(Fullscreen, True);
nxagentChangeOption(AllScreens, True);
nxagentIpaq = True;
}
else
......@@ -1071,10 +1075,14 @@ static void nxagentParseOptions(char *name, char *value)
else if (!strcmp(value, "1"))
{
nxagentChangeOption(Fullscreen, True);
nxagentChangeOption(AllScreens, True);
}
else if (!strcmp(value, "0"))
{
nxagentChangeOption(Fullscreen, False);
nxagentChangeOption(AllScreens, False);
}
else
{
......@@ -1680,6 +1688,11 @@ N/A
nxagentChangeOption(Fullscreen, False);
}
if (nxagentOption(AllScreens) == UNDEFINED)
{
nxagentChangeOption(AllScreens, False);
}
if (nxagentOption(Binder) == UNDEFINED)
{
nxagentChangeOption(Binder, False);
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -66,21 +66,21 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS];
static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
{
"NX_IDENTITY", /* 0 */
"WM_PROTOCOLS", /* 1 */
"WM_DELETE_WINDOW", /* 2 */
"WM_NX_READY", /* 3 */
"MCOPGLOBALS", /* 4 */
"NX_CUT_BUFFER_SERVER", /* 5 */
"TARGETS", /* 6 */
"TEXT", /* 7 */
"NX_AGENT_SIGNATURE", /* 8 */
"NXDARWIN", /* 9 */
"CLIPBOARD", /* 10 */
"TIMESTAMP", /* 11 */
"UTF8_STRING", /* 12 */
"_NET_WM_STATE", /* 13 */
"_NET_WM_STATE_FULLSCREEN", /* 14 */
"NX_IDENTITY", /* 0 */
"WM_PROTOCOLS", /* 1 */
"WM_DELETE_WINDOW", /* 2 */
"WM_NX_READY", /* 3 */
"MCOPGLOBALS", /* 4 */
"NX_CUT_BUFFER_SERVER", /* 5 */
"TARGETS", /* 6 */
"TEXT", /* 7 */
"NX_AGENT_SIGNATURE", /* 8 */
"NXDARWIN", /* 9 */
"CLIPBOARD", /* 10 */
"TIMESTAMP", /* 11 */
"UTF8_STRING", /* 12 */
"_NET_WM_STATE", /* 13 */
"_NET_WM_STATE_FULLSCREEN", /* 14 */
NULL,
NULL
};
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
ChangeLog:
nxagent-3.5.0-2
- Fixed TR0502449. Initialized font server path even if font server
connection fails.
nxagent-3.5.0-1
- Opened the 3.5.0 branch based on nxagent-3.4.0-16.
- Updated copyright to year 2009.
- Fixed TR0302438. Added a check in function exporting property in
order to handle the case looking up an atom name returns a null
pointer.
nxagent-3.4.0-16
- Updated copyright to year 2011.
nxagent-3.4.0-15
- Added reference to fixed TR11H02405.
nxagent-3.4.0-14
- Reverted fix for TR03H02335 implemented in nxagent-3.4.0-6. The
emulation of right click by Control key + left click introduces
issues for some applications changing the reaction to the left click
depending on the state of Control key. Issue reported in TR03H02335
affects Apple laptop touchpads having a single button acting as
left button: on those devices the right button can be emulated by
a double-fingered tap (using two fingertips simultaneously).
nxagent-3.4.0-13
- Fixed TR12H02414. Exported property must be split if ChangeProperty
request exceeds 262140 bytes.
- Reset AllScreens option at reconnection time if full screen mode
have to be automatically turned off.
nxagent-3.4.0-12
- If one of the two full screen modes is active ('one screen' or 'all
screens') both keystrokes Ctrl-Alt-F and Ctrl-Alt-Shift-F change the
mode back to 'windowed'.
- Fixed TR11H02405. XRenderFreePicture is called only for pictures
that were actually created on the X server side.
- Ctrl+Alt+f switch fullscreen to all monitors, while Ctrl+Alt+Shift+f
does it to one monitor only.
- If the fullscreen option is enabled at the startup, session starts
in the fullscreen mode on all monitors.
- Added a call to XReparentWindow in the nxagentSwitchAllScreens().
- Corrected focus and grab when switching to fullscreen on
all monitors.
- Removed a compile warning e deleted some unused variables.
- Removed nxagentPointerAndKeyboardGrabbed variable.
- Use the override redirect attribute to switch to fullscreen to all
monitors instead of send _NET_WM_FULLSCREEN_MONITORS hint to the WM.
- Added nxagentMinimizeFromFullScreen(), nxagentMaximizeToFullScreen()
and nxagentCreateIconWindow().
- Removed check on EnterNotify to grab the keyboard in fullscreen
mode not only if mode is 'NotifyNormal'.
nxagent-3.4.0-11
- Corrected switching between viewport mode and resize mode.
- Fixed TR04H02340. Keycode is correctly translated in shadow sessions
also if the remote X display is using evdev.
nxagent-3.4.0-10
- Handled XGrabKeyboard() return value.
- Fixed TR10D01512. NumLock and CapsLock keys are now synchronized
between local and remote.
nxagent-3.4.0-9
- Fixed TR06H02362. No icon was swown in the task bar.
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -33,6 +33,7 @@ enum HandleEventResult
doCloseSession,
doStartKbd,
doSwitchFullscreen,
doSwitchAllScreens,
doViewportMoveUp,
doViewportMoveLeft,
doViewportMoveRight,
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -1269,7 +1269,7 @@ Bool nxagentReconnectFailedFonts(void *p0)
const int maxAttempt = 5;
char **fontPaths, **localFontPaths, **newFontPaths;
char fontServerPath[256];
char fontServerPath[256] = "";
int nPaths = 0;
Bool repeat = True;
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -74,7 +74,7 @@ is" without express or implied warranty.
#undef DEBUG
#undef DUMP
#define NXAGENT_VERSION "3.4.0"
#define NXAGENT_VERSION "3.5.0"
/*
* ProcVector array defined in tables.c.
......@@ -193,7 +193,7 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
if (serverGeneration <= 1)
{
fprintf(stderr, "\nNXAGENT - Version " NXAGENT_VERSION "\n\n");
fprintf(stderr, "Copyright (C) 2001, 2010 NoMachine.\n");
fprintf(stderr, "Copyright (C) 2001, 2011 NoMachine.\n");
fprintf(stderr, "See http://www.nomachine.com/ for more information.\n\n");
fprintf(stderr, "Info: Agent running with pid '%d'.\n", getpid());
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -116,7 +116,7 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
{
if (nxagentOption(Rootless) == False)
{
*result = doSwitchFullscreen;
*result = doSwitchAllScreens;
}
break;
......@@ -282,6 +282,16 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
{
switch (sym)
{
case XK_f:
case XK_F:
{
if (nxagentOption(Rootless) == 0)
{
*result = doSwitchFullscreen;
}
break;
}
case XK_Left:
case XK_KP_Left:
{
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
Copyright (c) 2001, 2010 NoMachine - http://www.nomachine.com/.
Copyright (c) 2001, 2011 NoMachine - http://www.nomachine.com/.
NXAGENT and NX extensions to X are copyright of NoMachine.
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -31,7 +31,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -31,7 +31,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
......@@ -6,7 +6,7 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -103,6 +103,13 @@ typedef struct _AgentOptions
int Fullscreen;
/*
* True if the fullscreen NX session will
* extend on all available screens.
*/
int AllScreens;
/*
* Set to the auto-disconnect timeout, if
* the user activated this feature.
*/
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -584,16 +584,16 @@ XRenderPictFormat *nxagentMatchingFormats(PictFormatPtr pFormat)
void nxagentDestroyPicture(PicturePtr pPicture)
{
if (pPicture == NULL || nxagentPicturePriv(pPicture) -> picture == 0)
{
return;
}
#ifdef TEST
fprintf(stderr, "nxagentDestroyPicture: Going to destroy picture at [%p].\n",
(void *) pPicture);
#endif
if (pPicture == NULL)
{
return;
}
XRenderFreePicture(nxagentDisplay,
nxagentPicturePriv(pPicture) -> picture);
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -625,6 +625,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
{
XlibAtom *atoms = malloc(nUnits * sizeof(*atoms));
Atom *input = value;
char *atomName = NULL;
int i;
int j = 0;
......@@ -644,7 +645,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
* instead of just getting rid of the property.
*/
if (strcmp(NameForAtom(input[i]), "_NET_WM_PING") != 0)
if ((atomName = NameForAtom(input[i])) != NULL &&
strcmp(atomName, "_NET_WM_PING") != 0)
{
atoms[j] = nxagentLocalToRemoteAtom(input[i]);
......@@ -652,7 +654,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
{
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n",
(long int) input[i], validateString(NameForAtom(input[i])));
(long int) input[i], validateString(atomName));
#endif
}
......@@ -725,7 +727,57 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
}
else
{
XChangeProperty(nxagentDisplay, nxagentWindow(pWin), propertyX, typeX, format, mode, (void*)output, nUnits);
#ifdef TEST
fprintf(stderr, "nxagentExportProperty: Property [%lu] format [%i] "
"units [%lu].\n", propertyX, format, nUnits);
#endif
if ((format >> 3) * nUnits + sizeof(xChangePropertyReq) <
(MAX_REQUEST_SIZE << 2))
{
XChangeProperty(nxagentDisplay, nxagentWindow(pWin), propertyX, typeX,
format, mode, (void*)output, nUnits);
}
else if (mode == PropModeReplace)
{
int n;
char *data;
XDeleteProperty(nxagentDisplay, nxagentWindow(pWin), propertyX);
data = (char *) output;
while (nUnits > 0)
{
if ((format >> 3) * nUnits + sizeof(xChangePropertyReq) <
(MAX_REQUEST_SIZE << 2))
{
n = nUnits;
}
else
{
n = ((MAX_REQUEST_SIZE << 2) - sizeof(xChangePropertyReq)) /
(format >> 3);
}
XChangeProperty(nxagentDisplay, nxagentWindow(pWin), propertyX,
typeX, format, PropModeAppend, (void*) data, n);
nUnits -= n;
data = (char *) data + n * (format >> 3);
}
}
else
{
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! "
"Property [%lu] too long.\n", propertyX);
#endif
goto nxagentExportPropertyError;
}
nxagentAddPropertyToList(propertyX, pWin);
}
}
......@@ -740,6 +792,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
#endif
}
nxagentExportPropertyError:
if (freeMem)
{
xfree(output);
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -160,6 +160,7 @@ void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
#endif
Window nxagentIconWindow = None;
Window nxagentFullscreenWindow = None;
#ifdef VIEWPORT_FRAME
......@@ -287,6 +288,166 @@ void nxagentSetPixmapFormats(ScreenInfo *screenInfo)
}
}
void nxagentMinimizeFromFullScreen(ScreenPtr pScreen)
{
XUnmapWindow(nxagentDisplay, nxagentFullscreenWindow);
if (nxagentIpaq)
{
XMapWindow(nxagentDisplay, nxagentIconWindow);
XIconifyWindow(nxagentDisplay, nxagentIconWindow,
DefaultScreen(nxagentDisplay));
}
else
{
XIconifyWindow(nxagentDisplay, nxagentIconWindow,
DefaultScreen(nxagentDisplay));
}
}
void nxagentMaximizeToFullScreen(ScreenPtr pScreen)
{
if (nxagentIpaq)
{
XUnmapWindow(nxagentDisplay, nxagentIconWindow);
XMapWindow(nxagentDisplay, nxagentFullscreenWindow);
}
else
{
/*
XUnmapWindow(nxagentDisplay, nxagentIconWindow);
*/
/*
FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWindow()
in order to avoid the session window is iconified.
We could avoid the sesssion window is iconified when a LeaveNotify event is received,
so this check would be unnecessary.
*/
struct timeval timeout;
int i;
XEvent e;
XReparentWindow(nxagentDisplay, nxagentFullscreenWindow,
RootWindow(nxagentDisplay, DefaultScreen(nxagentDisplay)), 0, 0);
for (i = 0; i < 100 && nxagentWMIsRunning; i++)
{
#ifdef TEST
fprintf(stderr, "nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event.\n");
#endif
if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e))
{
break;
}
XSync(nxagentDisplay, 0);
timeout.tv_sec = 0;
timeout.tv_usec = 50 * 1000;
nxagentWaitEvents(nxagentDisplay, &timeout);
}
XMapRaised(nxagentDisplay, nxagentFullscreenWindow);
XIconifyWindow(nxagentDisplay, nxagentIconWindow,
DefaultScreen(nxagentDisplay));
while (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, LeaveNotify, &e));
/*
XMapWindow(nxagentDisplay, nxagentIconWindow);
*/
}
}
Window nxagentCreateIconWindow()
{
XSetWindowAttributes attributes;
unsigned long valuemask;
char* window_name;
XTextProperty windowName;
XSizeHints sizeHints;
XWMHints wmHints;
Window w;
Mask mask;
/*
* Create icon window.
*/
attributes.override_redirect = False;
attributes.colormap = DefaultColormap(nxagentDisplay, DefaultScreen(nxagentDisplay));
attributes.background_pixmap = nxagentScreenSaverPixmap;
valuemask = CWOverrideRedirect | CWBackPixmap | CWColormap;
#ifdef TEST
fprintf(stderr, "nxagentCreateIconWindow: Going to create new icon window.\n");
#endif
w = XCreateWindow(nxagentDisplay, DefaultRootWindow(nxagentDisplay),
0, 0, 1, 1, 0,
DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)),
InputOutput,
DefaultVisual(nxagentDisplay, DefaultScreen(nxagentDisplay)),
valuemask, &attributes);
#ifdef TEST
fprintf(stderr, "nxagentCreateIconWindow: Created new icon window with id [%ld].\n",
nxagentIconWindow);
#endif
/*
* Set hints to the window manager for the icon window.
*/
window_name = nxagentWindowName;
XStringListToTextProperty(&window_name, 1, &windowName);
sizeHints.flags = PMinSize | PMaxSize;
sizeHints.min_width = sizeHints.max_width = 1;
sizeHints.min_height = sizeHints.max_height = 1;
wmHints.flags = IconPixmapHint | IconMaskHint;
wmHints.initial_state = IconicState;
wmHints.icon_pixmap = nxagentIconPixmap;
if (useXpmIcon)
{
wmHints.icon_mask = nxagentIconShape;
wmHints.flags = IconPixmapHint | IconMaskHint;
}
else
{
wmHints.flags = StateHint | IconPixmapHint;
}
XSetWMProperties(nxagentDisplay, w,
&windowName, &windowName,
NULL , 0 , &sizeHints, &wmHints, NULL);
/*
* Enable events from the icon window.
*/
nxagentGetDefaultEventMask(&mask);
XSelectInput(nxagentDisplay, w, (mask & ~(KeyPressMask |
KeyReleaseMask)) | StructureNotifyMask);
/*
* Notify to client if user closes icon window.
*/
if (nxagentWMIsRunning && !nxagentOption(Rootless))
{
XlibAtom deleteWMAtom = nxagentAtoms[2]; /* WM_DELETE_WINDOW */
XSetWMProtocols(nxagentDisplay, w, &deleteWMAtom, 1);
}
return w;
}
Bool nxagentMagicPixelZone(int x, int y)
{
return (x >= nxagentOption(Width) - 1 && y < 1);
......@@ -816,6 +977,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
nxagentChangeOption(Fullscreen, False);
nxagentChangeOption(AllScreens, False);
nxagentFullscreenWindow = 0;
resetAgentPosition = True;
......@@ -1221,6 +1384,11 @@ N/A
nxagentChangeOption(Height, gattributes.height);
}
if (nxagentOption(AllScreens))
{
attributes.override_redirect = True;
}
if (nxagentOption(Fullscreen))
{
/*
......@@ -1448,7 +1616,8 @@ N/A
if (nxagentDoFullGeneration == 1 ||
nxagentReconnectTrap == 1)
{
valuemask = CWBackPixel | CWEventMask | CWColormap;
valuemask = CWBackPixel | CWEventMask | CWColormap |
(nxagentOption(AllScreens) == 1 ? CWOverrideRedirect : 0);
attributes.background_pixel = nxagentBlackPixel;
......@@ -1456,6 +1625,11 @@ N/A
attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen));
if (nxagentOption(AllScreens) == 1)
{
attributes.override_redirect = True;
}
if (nxagentOption(Fullscreen) == 1)
{
if (nxagentReconnectTrap)
......@@ -1635,6 +1809,21 @@ N/A
XClearWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(AllScreens))
{
if (nxagentReconnectTrap)
{
XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, True, GrabModeAsync,
GrabModeAsync, CurrentTime);
}
nxagentIconWindow = nxagentCreateIconWindow();
}
else
{
nxagentIconWindow = 0;
}
/*
* When we don't have window manager we grab keyboard
* to let nxagent get keyboard events.
......@@ -1983,8 +2172,6 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
int oldMmWidth;
int oldMmHeight;
RegionPtr pRootWinSize;
#ifdef TEST
nxagentPrintAgentGeometry("Before Resize Screen", "nxagentResizeScreen:");
#endif
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
......@@ -47,6 +47,8 @@ extern ScreenPtr nxagentDefaultScreen;
extern Pixmap nxagentPixmapLogo;
extern Window nxagentIconWindow;
extern Window nxagentFullscreenWindow;
extern RegionRec nxagentShadowUpdateRegion;
......@@ -87,6 +89,12 @@ extern int nxagentBitsPerPixel(int depth);
void nxagentSetScreenSaverTime(void);
void nxagentMinimizeFromFullScreen(ScreenPtr pScreen);
void nxagentMaximizeToFullScreen(ScreenPtr pScreen);
Window nxagentCreateIconWindow(void);
Bool nxagentMagicPixelZone(int x, int y);
Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment