Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
04962efa
Unverified
Commit
04962efa
authored
Jan 05, 2020
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/xlib_types' into 3.6.x
Attributes GH PR #883:
https://github.com/ArcticaProject/nx-libs/pull/883
parents
a261b724
427b7b97
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
72 additions
and
68 deletions
+72
-68
Atoms.c
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+10
-10
Atoms.h
nx-X11/programs/Xserver/hw/nxagent/Atoms.h
+16
-6
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+14
-15
Keyboard.c
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+4
-8
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+7
-7
Rootless.h
nx-X11/programs/Xserver/hw/nxagent/Rootless.h
+9
-3
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+1
-1
Screen.h
nx-X11/programs/Xserver/hw/nxagent/Screen.h
+6
-0
Splash.c
nx-X11/programs/Xserver/hw/nxagent/Splash.c
+0
-14
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+2
-3
Windows.h
nx-X11/programs/Xserver/hw/nxagent/Windows.h
+3
-1
No files found.
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
View file @
04962efa
...
...
@@ -325,7 +325,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen)
typedef
struct
{
Atom
local
;
Atom
remote
;
Xlib
Atom
remote
;
const
char
*
string
;
int
length
;
}
AtomMap
;
...
...
@@ -335,8 +335,8 @@ static unsigned int privAtomMapSize = 0;
static
unsigned
int
privLastAtom
=
0
;
static
void
nxagentExpandCache
(
void
);
static
void
nxagentWriteAtom
(
Atom
,
Atom
,
const
char
*
,
Bool
);
static
AtomMap
*
nxagentFindAtomByRemoteValue
(
Atom
);
static
void
nxagentWriteAtom
(
Atom
,
Xlib
Atom
,
const
char
*
,
Bool
);
static
AtomMap
*
nxagentFindAtomByRemoteValue
(
Xlib
Atom
);
static
AtomMap
*
nxagentFindAtomByLocalValue
(
Atom
);
static
AtomMap
*
nxagentFindAtomByName
(
char
*
,
unsigned
);
...
...
@@ -357,7 +357,7 @@ static void nxagentExpandCache(void)
* consequent allocation, then cache the atom-couple.
*/
static
void
nxagentWriteAtom
(
Atom
local
,
Atom
remote
,
const
char
*
string
,
Bool
duplicate
)
static
void
nxagentWriteAtom
(
Atom
local
,
Xlib
Atom
remote
,
const
char
*
string
,
Bool
duplicate
)
{
const
char
*
s
;
...
...
@@ -532,7 +532,7 @@ static AtomMap* nxagentFindAtomByLocalValue(Atom local)
return
NULL
;
}
static
AtomMap
*
nxagentFindAtomByRemoteValue
(
Atom
remote
)
static
AtomMap
*
nxagentFindAtomByRemoteValue
(
Xlib
Atom
remote
)
{
if
(
remote
==
None
||
remote
==
BAD_RESOURCE
)
{
...
...
@@ -574,7 +574,7 @@ static AtomMap* nxagentFindAtomByName(char *string, unsigned int length)
* I think this and the 2 .*Find.* are the only functions to look for performances.
*/
Atom
nxagentMakeAtom
(
char
*
string
,
unsigned
int
length
,
Bool
Makeit
)
Xlib
Atom
nxagentMakeAtom
(
char
*
string
,
unsigned
int
length
,
Bool
Makeit
)
{
AtomMap
*
current
;
...
...
@@ -622,7 +622,7 @@ Atom nxagentMakeAtom(char *string, unsigned int length, Bool Makeit)
*/
{
Atom
remote
=
XInternAtom
(
nxagentDisplay
,
string
,
!
Makeit
);
Xlib
Atom
remote
=
XInternAtom
(
nxagentDisplay
,
string
,
!
Makeit
);
if
(
remote
==
None
)
{
...
...
@@ -639,7 +639,7 @@ Atom nxagentMakeAtom(char *string, unsigned int length, Bool Makeit)
}
}
Atom
nxagentLocalToRemoteAtom
(
Atom
local
)
Xlib
Atom
nxagentLocalToRemoteAtom
(
Atom
local
)
{
#ifdef TEST
fprintf
(
stderr
,
"%s: entering
\n
"
,
__func__
);
...
...
@@ -673,7 +673,7 @@ Atom nxagentLocalToRemoteAtom(Atom local)
const
char
*
string
=
NameForAtom
(
local
);
Atom
remote
=
XInternAtom
(
nxagentDisplay
,
string
,
False
);
Xlib
Atom
remote
=
XInternAtom
(
nxagentDisplay
,
string
,
False
);
if
(
remote
==
None
)
{
...
...
@@ -693,7 +693,7 @@ Atom nxagentLocalToRemoteAtom(Atom local)
return
remote
;
}
Atom
nxagentRemoteToLocalAtom
(
Atom
remote
)
Atom
nxagentRemoteToLocalAtom
(
Xlib
Atom
remote
)
{
if
(
remote
==
None
||
remote
==
BAD_RESOURCE
)
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Atoms.h
View file @
04962efa
...
...
@@ -51,23 +51,33 @@ void nxagentInitAtoms();
int
nxagentQueryAtoms
(
ScreenPtr
pScreen
);
void
nxagentResetAtomMap
(
void
);
void
nxagentWMDetect
(
void
);
#ifdef XlibAtom
/*
* only provide these protoypes if the including file knows about Xlib
* types. This allows us including Atoms.h without having to use the
* Xlib type magic of Agent.h
*/
/*
* Create the atoms on the remote X server
* and cache the couple local-remote atoms.
*/
Atom
nxagentMakeAtom
(
char
*
,
unsigned
,
Bool
);
Xlib
Atom
nxagentMakeAtom
(
char
*
,
unsigned
,
Bool
);
/*
* Converts local atoms in remote atoms and
* viceversa.
*/
Atom
nxagentRemoteToLocalAtom
(
Atom
);
Atom
nxagentLocalToRemoteAtom
(
Atom
);
Atom
nxagentRemoteToLocalAtom
(
Xlib
Atom
);
Xlib
Atom
nxagentLocalToRemoteAtom
(
Atom
);
void
nxagentResetAtomMap
(
void
);
void
nxagentWMDetect
(
void
);
#endif
#endif
/* __Atoms_H__ */
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
04962efa
...
...
@@ -30,9 +30,9 @@
#include "windowstr.h"
#include "scrnintstr.h"
#include "Agent.h"
#include "Windows.h"
#include "Atoms.h"
#include "Agent.h"
#include "Args.h"
#include "Trap.h"
#include "Rootless.h"
...
...
@@ -72,7 +72,7 @@ static int agentClipboardStatus;
static
int
clientAccum
;
#endif
Atom
serverCutProperty
;
Xlib
Atom
serverCutProperty
;
Atom
clientCutProperty
;
static
Window
serverWindow
;
...
...
@@ -82,7 +82,7 @@ const int nxagentMaxSelections = 2;
typedef
struct
_SelectionOwner
{
Atom
selection
;
/* _external_ Atom */
XlibAtom
selection
;
/* _external_ Atom */
ClientPtr
client
;
/* internal client */
Window
window
;
/* internal window id */
WindowPtr
windowPtr
;
/* internal window struct */
...
...
@@ -96,7 +96,7 @@ typedef struct _SelectionOwner
* external atom of the selection
*/
static
SelectionOwner
*
lastSelectionOwner
;
static
Atom
nxagentLastRequestedSelection
;
static
Xlib
Atom
nxagentLastRequestedSelection
;
/*
* Needed to handle the notify selection event to
...
...
@@ -126,15 +126,15 @@ static unsigned long lastClientPropertySize;
static
ClientSelectionStage
lastClientStage
;
static
Window
lastServerRequestor
;
static
Atom
lastServerProperty
;
static
Atom
lastServerTarget
;
static
XlibAtom
lastServerProperty
;
static
XlibAtom
lastServerTarget
;
static
Time
lastServerTime
;
static
Atom
serverTARGETS
;
static
Atom
serverTIMESTAMP
;
static
Atom
serverTEXT
;
static
Atom
serverUTF8_STRING
;
static
Atom
serverClientCutProperty
;
static
Xlib
Atom
serverTARGETS
;
static
Xlib
Atom
serverTIMESTAMP
;
static
Xlib
Atom
serverTEXT
;
static
Xlib
Atom
serverUTF8_STRING
;
static
Xlib
Atom
serverClientCutProperty
;
static
Atom
clientTARGETS
;
static
Atom
clientTEXT
;
static
Atom
clientCOMPOUND_TEXT
;
...
...
@@ -209,7 +209,7 @@ XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, 0 };
extern
Display
*
nxagentDisplay
;
Bool
nxagentValidServerTargets
(
Atom
target
);
Bool
nxagentValidServerTargets
(
Xlib
Atom
target
);
static
void
endTransfer
(
Bool
success
);
#define SELECTION_SUCCESS True
#define SELECTION_FAULT False
...
...
@@ -448,7 +448,7 @@ int SendSelectionNotifyEventToClient(ClientPtr client,
* server, like .e.g XA_STRING or UTF8_STRING. Other, non content type
* targets like "TARGETS" or "TIMESTAMP" will return false.
*/
Bool
nxagentValidServerTargets
(
Atom
target
)
Bool
nxagentValidServerTargets
(
Xlib
Atom
target
)
{
if
(
target
==
XA_STRING
)
{
...
...
@@ -553,7 +553,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow)
nxagentPrintClipboardStat
(
"after nxagentClearClipboard"
);
}
int
nxagentFindLastSelectionOwnerIndex
(
Atom
sel
)
int
nxagentFindLastSelectionOwnerIndex
(
Xlib
Atom
sel
)
{
int
i
=
0
;
while
((
i
<
nxagentMaxSelections
)
&&
...
...
@@ -1992,7 +1992,6 @@ int nxagentSendNotify(xEvent *event)
WindowPtr
nxagentGetClipboardWindow
(
Atom
property
)
{
int
i
=
nxagentFindLastSelectionOwnerIndex
(
nxagentLastRequestedSelection
);
if
((
i
<
nxagentMaxSelections
)
&&
(
property
==
clientCutProperty
)
&&
(
lastSelectionOwner
[
i
].
windowPtr
!=
NULL
))
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
View file @
04962efa
...
...
@@ -1355,25 +1355,21 @@ static void nxagentXkbGetNames(void)
if
(
nxagentRemoteRules
)
return
;
Atom
atom
=
XInternAtom
(
nxagentDisplay
,
"_XKB_RULES_NAMES"
,
1
);
XlibAtom
rulesprop
=
XInternAtom
(
nxagentDisplay
,
"_XKB_RULES_NAMES"
,
1
);
if
(
atom
==
0
)
if
(
rulesprop
==
0
)
{
return
;
}
#ifdef _XSERVER64
Atom64
type
;
#else
Atom
type
;
#endif
XlibAtom
type
;
int
format
;
unsigned
long
n
;
unsigned
long
after
;
char
*
data
=
NULL
;
Status
result
=
XGetWindowProperty
(
nxagentDisplay
,
DefaultRootWindow
(
nxagentDisplay
),
atom
,
0
,
256
,
0
,
XA_STRING
,
&
type
,
&
format
,
rulesprop
,
0
,
256
,
0
,
XA_STRING
,
&
type
,
&
format
,
&
n
,
&
after
,
(
unsigned
char
**
)
&
data
);
if
(
result
!=
Success
||
!
data
)
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
04962efa
...
...
@@ -706,8 +706,8 @@ int nxagentExportProperty(WindowPtr pWin,
if
(
export
)
{
Atom
propertyX
=
nxagentLocalToRemoteAtom
(
property
);
Atom
typeX
=
nxagentLocalToRemoteAtom
(
type
);
Xlib
Atom
propertyX
=
nxagentLocalToRemoteAtom
(
property
);
Xlib
Atom
typeX
=
nxagentLocalToRemoteAtom
(
type
);
if
(
propertyX
==
None
||
typeX
==
None
)
{
...
...
@@ -794,8 +794,8 @@ int nxagentExportProperty(WindowPtr pWin,
}
void
nxagentImportProperty
(
Window
window
,
Atom
property
,
Atom
type
,
Xlib
Atom
property
,
Xlib
Atom
type
,
int
format
,
unsigned
long
nitems
,
unsigned
long
bytes_after
,
...
...
@@ -1001,7 +1001,7 @@ void nxagentImportProperty(Window window,
else
if
(
strcmp
(
typeS
,
"ATOM"
)
==
0
)
{
Atom
*
atoms
=
malloc
(
nitems
*
sizeof
(
Atom
));
Atom
*
input
=
(
Atom
*
)
buffer
;
XlibAtom
*
input
=
(
Xlib
Atom
*
)
buffer
;
if
(
atoms
==
NULL
)
{
...
...
@@ -1107,7 +1107,7 @@ void nxagentImportProperty(Window window,
struct
nxagentPropertyRec
{
Window
window
;
Atom
property
;
Xlib
Atom
property
;
struct
nxagentPropertyRec
*
next
;
};
...
...
@@ -1148,7 +1148,7 @@ void nxagentRemovePropertyFromList(void)
* Add the record to the list.
*/
void
nxagentAddPropertyToList
(
Atom
property
,
WindowPtr
pWin
)
void
nxagentAddPropertyToList
(
Xlib
Atom
property
,
WindowPtr
pWin
)
{
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.h
View file @
04962efa
...
...
@@ -46,13 +46,15 @@ extern WindowPtr nxagentRootlessWindow;
* connected to the real X server.
*/
#ifdef XlibAtom
typedef
struct
{
Window
window
;
Atom
property
;
Xlib
Atom
property
;
}
PropertyRequestRec
;
extern
PropertyRequestRec
nxagentPropertyRequests
[
256
];
#endif
Window
nxagentRootlessWindowParent
(
WindowPtr
pWin
);
...
...
@@ -75,14 +77,18 @@ int nxagentExportProperty(WindowPtr pWin, Atom property, Atom type, int format,
#define MAX_RETRIEVED_PROPERTY_SIZE 256 * 1024
void
nxagentImportProperty
(
Window
window
,
Atom
property
,
Atom
type
,
int
format
,
#ifdef XlibAtom
void
nxagentImportProperty
(
Window
window
,
XlibAtom
property
,
XlibAtom
type
,
int
format
,
unsigned
long
nitems
,
unsigned
long
bytes_after
,
unsigned
char
*
buffer
);
#endif
/*
* Push last ChangeProperty to the list.
*/
void
nxagentAddPropertyToList
(
Atom
property
,
WindowPtr
pWin
);
#ifdef XlibAtom
void
nxagentAddPropertyToList
(
XlibAtom
property
,
WindowPtr
pWin
);
#endif
/*
* Check if a PropertyNotify match the top
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
04962efa
...
...
@@ -149,7 +149,7 @@ Window nxagentInputWindows[MAXSCREENS];
Window
nxagentScreenSaverWindows
[
MAXSCREENS
];
#ifdef NXAGENT_ONSTART
Atom
nxagentReadyAtom
;
Xlib
Atom
nxagentReadyAtom
;
#endif
ScreenPtr
nxagentDefaultScreen
=
NULL
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.h
View file @
04962efa
...
...
@@ -49,6 +49,12 @@ is" without express or implied warranty.
#define nxagentSetPrintGeometry(screen) \
nxagentPrintGeometryFlags = (1 << (screen));
#ifdef NXAGENT_ONSTART
#ifdef XlibAtom
extern
XlibAtom
nxagentReadyAtom
;
#endif
#endif
extern
int
nxagentClients
;
extern
int
nxagentAutoDisconnectTimeout
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Splash.c
View file @
04962efa
...
...
@@ -69,20 +69,6 @@ Bool nxagentWMPassed = False;
static
void
nxagentPaintLogo
(
Window
win
,
GC
gc
,
int
scale
,
int
width
,
int
height
);
/*
* From Screen.c.
*/
#ifdef NXAGENT_ONSTART
extern
Atom
nxagentReadyAtom
;
#endif
/*
* From Clipboard.c.
*/
extern
Atom
serverCutProperty
;
void
nxagentShowSplashWindow
(
Window
parentWindow
)
{
XWindowAttributes
getAttributes
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
04962efa
...
...
@@ -422,7 +422,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
if
(
nxagentOption
(
Rootless
)
&&
nxagentWindowTopLevel
(
pWin
))
{
Atom
prop
=
nxagentMakeAtom
(
"WM_PROTOCOLS"
,
strlen
(
"WM_PROTOCOLS"
),
True
);
Xlib
Atom
prop
=
nxagentMakeAtom
(
"WM_PROTOCOLS"
,
strlen
(
"WM_PROTOCOLS"
),
True
);
XlibAtom
atom
=
nxagentMakeAtom
(
"WM_DELETE_WINDOW"
,
strlen
(
"WM_DELETE_WINDOW"
),
True
);
XSetWMProtocols
(
nxagentDisplay
,
nxagentWindowPriv
(
pWin
)
->
window
,
&
atom
,
1
);
...
...
@@ -3054,8 +3054,7 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
{
if
(
nxagentWindowTopLevel
(
pWin
))
{
Atom
prop
=
nxagentMakeAtom
(
"WM_PROTOCOLS"
,
strlen
(
"WM_PROTOCOLS"
),
True
);
XlibAtom
prop
=
nxagentMakeAtom
(
"WM_PROTOCOLS"
,
strlen
(
"WM_PROTOCOLS"
),
True
);
XlibAtom
atom
=
nxagentMakeAtom
(
"WM_DELETE_WINDOW"
,
strlen
(
"WM_DELETE_WINDOW"
),
True
);
XSetWMProtocols
(
nxagentDisplay
,
nxagentWindow
(
pWin
),
&
atom
,
1
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Windows.h
View file @
04962efa
...
...
@@ -177,7 +177,9 @@ do\
WindowPtr
nxagentWindowPtr
(
Window
window
);
extern
Atom
serverCutProperty
;
#ifdef XlibAtom
extern
XlibAtom
serverCutProperty
;
#endif
/*
* If the rectangles in an exposed region exceed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment