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
48b91481
Unverified
Commit
48b91481
authored
Nov 04, 2020
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/various5' into 3.6.x
Attributes GH PR #963:
https://github.com/ArcticaProject/nx-libs/pull/963
parents
6cd4f123
252b86ee
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
190 additions
and
250 deletions
+190
-250
panoramiX.c
nx-X11/programs/Xserver/Xext/panoramiX.c
+7
-7
Atoms.c
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+2
-3
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+10
-3
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+2
-2
GCs.h
nx-X11/programs/Xserver/hw/nxagent/GCs.h
+1
-1
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+37
-37
Compext.c
nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c
+92
-169
Jpeg.c
nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c
+4
-2
Png.c
nx-X11/programs/Xserver/hw/nxagent/compext/Png.c
+15
-13
Z.c
nx-X11/programs/Xserver/hw/nxagent/compext/Z.c
+4
-2
nx-libs.spec
nx-libs.spec
+5
-0
Channel.h
nxcomp/src/Channel.h
+4
-4
Log.h
nxcomp/src/Log.h
+7
-7
No files found.
nx-X11/programs/Xserver/Xext/panoramiX.c
View file @
48b91481
...
...
@@ -601,8 +601,8 @@ extern Bool CreateConnectionBlock(void);
Bool
PanoramiXCreateConnectionBlock
(
void
)
{
int
i
,
j
,
length
;
Bool
disable
BackingS
tore
=
FALSE
;
Bool
disable
SaveU
nders
=
FALSE
;
Bool
disable
_backing_s
tore
=
FALSE
;
Bool
disable
_save_u
nders
=
FALSE
;
int
old_width
,
old_height
;
float
width_mult
,
height_mult
;
xWindowRoot
*
root
;
...
...
@@ -627,17 +627,17 @@ Bool PanoramiXCreateConnectionBlock(void)
return
FALSE
;
}
if
(
pScreen
->
backingStoreSupport
!=
screenInfo
.
screens
[
0
]
->
backingStoreSupport
)
disable
BackingS
tore
=
TRUE
;
disable
_backing_s
tore
=
TRUE
;
if
(
pScreen
->
saveUnderSupport
!=
screenInfo
.
screens
[
0
]
->
saveUnderSupport
)
disable
SaveU
nders
=
TRUE
;
disable
_save_u
nders
=
TRUE
;
}
if
(
disable
BackingStore
||
disableSaveU
nders
)
{
if
(
disable
_backing_store
||
disable_save_u
nders
)
{
for
(
i
=
0
;
i
<
screenInfo
.
numScreens
;
i
++
)
{
pScreen
=
screenInfo
.
screens
[
i
];
if
(
disable
BackingS
tore
)
if
(
disable
_backing_s
tore
)
pScreen
->
backingStoreSupport
=
NotUseful
;
if
(
disable
SaveU
nders
)
if
(
disable
_save_u
nders
)
pScreen
->
saveUnderSupport
=
NotUseful
;
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
View file @
48b91481
...
...
@@ -42,7 +42,6 @@
#include "Display.h"
#include "Screen.h"
#include "Options.h"
#include "Agent.h"
#include "Utils.h"
/*
...
...
@@ -709,7 +708,7 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local)
if
(
current
->
string
)
fprintf
(
stderr
,
"%s: local [%d] -> remote [%d (%s)]
\n
"
,
__func__
,
local
,
current
->
remote
,
current
->
string
);
else
fprintf
(
stderr
,
"%s: local [%d] -> remote [%d]
\n
"
,
__func__
,
local
,
current
->
remote
);
fprintf
(
stderr
,
"%s: local [%d] -> remote [%d]
(no string cached)
\n
"
,
__func__
,
local
,
current
->
remote
);
#endif
return
current
->
remote
;
...
...
@@ -718,7 +717,7 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local)
{
const
char
*
string
=
NameForAtom
(
local
);
/* F
IXME: why False?
*/
/* F
alse means "create Atom if it does not exist yet"
*/
XlibAtom
remote
=
XInternAtom
(
nxagentDisplay
,
string
,
False
);
if
(
remote
==
None
)
...
...
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
48b91481
...
...
@@ -292,7 +292,7 @@ static void printSelectionStat(int sel)
#else
fprintf
(
stderr
,
" CurrentSelections[].client [%p] index [%d]
\n
"
,
(
void
*
)
curSel
.
client
,
CLINDEX
(
curSel
.
client
);
CLINDEX
(
curSel
.
client
)
)
;
#endif
fprintf
(
stderr
,
" CurrentSelections[].window [0x%x]
\n
"
,
curSel
.
window
);
return
;
...
...
@@ -1937,17 +1937,23 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
*/
XlibAtom
p
=
serverTransToAgentProperty
;
XlibAtom
t
;
#ifdef DEBUG
char
*
pstr
=
"NX_CUT_BUFFER_SERVER"
;
const
char
*
tstr
;
#endif
if
(
target
==
clientUTF8_STRING
)
{
t
=
serverUTF8_STRING
;
#ifdef DEBUG
tstr
=
szAgentUTF8_STRING
;
#endif
}
else
{
t
=
XA_STRING
;
#ifdef DEBUG
tstr
=
validateString
(
NameForAtom
(
XA_STRING
));
#endif
}
#ifdef DEBUG
...
...
@@ -2025,11 +2031,12 @@ int nxagentSendNotify(xEvent *event)
* communication happens completely between our own clients (some of
* which can be nxagents themselves). In that case we return 0 (tell
* dix to go on) and do nothing!
* Be sure to not let this trigger for the failure answer (property 0)
*/
if
(
event
->
u
.
selectionNotify
.
property
!=
clientCutProperty
||
lastServerRequestor
==
None
)
if
(
!
(
event
->
u
.
selectionNotify
.
property
==
clientCutProperty
||
event
->
u
.
selectionNotify
.
property
==
0
)
||
lastServerRequestor
==
None
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: sent nothing.
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: sent nothing
- message to real X server is not required
.
\n
"
,
__func__
);
#endif
return
0
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
48b91481
...
...
@@ -2851,10 +2851,10 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X)
fprintf
(
stderr
,
"%s: Handling event.
\n
"
,
__func__
);
#endif
Atom
local
=
nxagentRemoteToLocalAtom
(
xfixesEvent
->
xfixesselection
.
selection
);
if
(
SelectionCallback
)
{
Atom
local
=
nxagentRemoteToLocalAtom
(
xfixesEvent
->
xfixesselection
.
selection
);
int
i
=
nxagentFindCurrentSelectionIndex
(
local
);
if
(
i
<
NumCurrentSelections
)
{
...
...
nx-X11/programs/Xserver/hw/nxagent/GCs.h
View file @
48b91481
...
...
@@ -42,7 +42,7 @@ is" without express or implied warranty.
extern
RESTYPE
RT_NX_GC
;
/* This file uses the GC definition f
or
m Xlib.h as XlibGC. */
/* This file uses the GC definition f
ro
m Xlib.h as XlibGC. */
typedef
struct
{
XlibGC
gc
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
48b91481
...
...
@@ -341,7 +341,7 @@ void nxagentMaximizeToFullScreen(ScreenPtr pScreen)
XUnmapWindow(nxagentDisplay, nxagentIconWindow);
*/
Window
root
=
RootWindow
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
Window
root
=
RootWindow
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
/*
FIXME: We'll check for ReparentNotify and LeaveNotify events after
...
...
@@ -351,55 +351,55 @@ FIXME: We'll check for ReparentNotify and LeaveNotify events after
unnecessary.
*/
/* only reparent if necessary. FIXME: also check if the desired coordinates match */
/* only reparent if necessary. FIXME: also check if the desired coordinates match */
if
(
!
nxagentIsParentOf
(
nxagentDisplay
,
root
,
nxagentFullscreenWindow
))
{
XReparentWindow
(
nxagentDisplay
,
nxagentFullscreenWindow
,
root
,
0
,
0
);
if
(
!
nxagentIsParentOf
(
nxagentDisplay
,
root
,
nxagentFullscreenWindow
))
{
XReparentWindow
(
nxagentDisplay
,
nxagentFullscreenWindow
,
root
,
0
,
0
);
for
(
int
i
=
0
;
i
<
100
&&
nxagentWMIsRunning
;
i
++
)
{
XEvent
e
;
for
(
int
i
=
0
;
i
<
100
&&
nxagentWMIsRunning
;
i
++
)
{
XEvent
e
;
#ifdef TEST
fprintf
(
stderr
,
"nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event [%d].
\n
"
,
i
);
#endif
#ifdef TEST
fprintf
(
stderr
,
"nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event [%d].
\n
"
,
i
);
#endif
if
(
XCheckTypedWindowEvent
(
nxagentDisplay
,
nxagentFullscreenWindow
,
ReparentNotify
,
&
e
))
{
break
;
}
if
(
XCheckTypedWindowEvent
(
nxagentDisplay
,
nxagentFullscreenWindow
,
ReparentNotify
,
&
e
))
{
break
;
}
XSync
(
nxagentDisplay
,
0
);
XSync
(
nxagentDisplay
,
0
);
nxagentWaitEvents
(
nxagentDisplay
,
50
);
}
}
else
{
#ifdef TEST
fprintf
(
stderr
,
"%s: FullscreenWindow already is child of root window - skipping reparenting,
\n
"
,
__func__
);
#endif
nxagentWaitEvents
(
nxagentDisplay
,
50
);
}
}
else
{
#ifdef TEST
fprintf
(
stderr
,
"%s: FullscreenWindow already is child of root window - skipping reparenting,
\n
"
,
__func__
);
#endif
}
XMapRaised
(
nxagentDisplay
,
nxagentFullscreenWindow
);
XIconifyWindow
(
nxagentDisplay
,
nxagentIconWindow
,
DefaultScreen
(
nxagentDisplay
));
/* swallow all LeaveNotify events for the FullscreenWindow;
Normally this does not swallow anything these days, but when
using fvwm you see one of these events here. */
while
(
1
)
{
XEvent
e
;
if
(
!
XCheckTypedWindowEvent
(
nxagentDisplay
,
nxagentFullscreenWindow
,
LeaveNotify
,
&
e
))
break
;
#ifdef TEST
fprintf
(
stderr
,
"%s: swallowing LeaveNotify event
\n
"
,
__func__
);
#endif
}
/* swallow all LeaveNotify events for the FullscreenWindow;
Normally this does not swallow anything these days, but when
using fvwm you see one of these events here. */
while
(
1
)
{
XEvent
e
;
if
(
!
XCheckTypedWindowEvent
(
nxagentDisplay
,
nxagentFullscreenWindow
,
LeaveNotify
,
&
e
))
break
;
#ifdef TEST
fprintf
(
stderr
,
"%s: swallowing LeaveNotify event
\n
"
,
__func__
);
#endif
}
/*
XMapWindow(nxagentDisplay, nxagentIconWindow);
...
...
nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c
View file @
48b91481
...
...
@@ -69,6 +69,7 @@
#include "Rle.h"
#include "Z.h"
#include "../Utils.h"
#define PANIC
#define WARNING
...
...
@@ -345,7 +346,7 @@ int _NXInternalResetResources(Display *dpy)
{
DeqAsyncHandler
(
dpy
,
_NXCollectedImages
[
i
]
->
handler
);
free
(
_NXCollectedImages
[
i
]
->
handler
);
SAFE_
free
(
_NXCollectedImages
[
i
]
->
handler
);
}
if
(
_NXCollectedImages
[
i
]
->
image
!=
NULL
)
...
...
@@ -353,9 +354,7 @@ int _NXInternalResetResources(Display *dpy)
XDestroyImage
(
_NXCollectedImages
[
i
]
->
image
);
}
free
(
_NXCollectedImages
[
i
]);
_NXCollectedImages
[
i
]
=
NULL
;
SAFE_free
(
_NXCollectedImages
[
i
]);
}
if
(
_NXCollectedProperties
[
i
]
!=
NULL
)
...
...
@@ -369,17 +368,12 @@ int _NXInternalResetResources(Display *dpy)
{
DeqAsyncHandler
(
dpy
,
_NXCollectedProperties
[
i
]
->
handler
);
free
(
_NXCollectedProperties
[
i
]
->
handler
);
}
if
(
_NXCollectedProperties
[
i
]
->
data
!=
NULL
)
{
free
(
_NXCollectedProperties
[
i
]
->
data
);
SAFE_free
(
_NXCollectedProperties
[
i
]
->
handler
);
}
free
(
_NXCollectedProperties
[
i
]
);
SAFE_free
(
_NXCollectedProperties
[
i
]
->
data
);
_NXCollectedProperties
[
i
]
=
NULL
;
SAFE_free
(
_NXCollectedProperties
[
i
])
;
}
if
(
_NXCollectedGrabPointers
[
i
]
!=
NULL
)
...
...
@@ -393,12 +387,10 @@ int _NXInternalResetResources(Display *dpy)
{
DeqAsyncHandler
(
dpy
,
_NXCollectedGrabPointers
[
i
]
->
handler
);
free
(
_NXCollectedGrabPointers
[
i
]
->
handler
);
SAFE_
free
(
_NXCollectedGrabPointers
[
i
]
->
handler
);
}
free
(
_NXCollectedGrabPointers
[
i
]);
_NXCollectedGrabPointers
[
i
]
=
NULL
;
SAFE_free
(
_NXCollectedGrabPointers
[
i
]);
}
if
(
_NXCollectedInputFocuses
[
i
]
!=
NULL
)
...
...
@@ -412,12 +404,10 @@ int _NXInternalResetResources(Display *dpy)
{
DeqAsyncHandler
(
dpy
,
_NXCollectedInputFocuses
[
i
]
->
handler
);
free
(
_NXCollectedInputFocuses
[
i
]
->
handler
);
SAFE_
free
(
_NXCollectedInputFocuses
[
i
]
->
handler
);
}
free
(
_NXCollectedInputFocuses
[
i
]);
_NXCollectedInputFocuses
[
i
]
=
NULL
;
SAFE_free
(
_NXCollectedInputFocuses
[
i
]);
}
}
...
...
@@ -488,10 +478,7 @@ int NXSetDisplayBuffer(Display *dpy, int size)
return
-
1
;
}
if
(
dpy
->
buffer
!=
NULL
)
{
free
(
dpy
->
buffer
);
}
SAFE_free
(
dpy
->
buffer
);
dpy
->
buffer
=
buffer
;
dpy
->
bufptr
=
dpy
->
buffer
;
...
...
@@ -2190,7 +2177,7 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method)
dst_data_size
);
#endif
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2224,9 +2211,9 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method)
fprintf
(
stderr
,
"******NXPackImage: PANIC! Failed to clean the image.
\n
"
);
#endif
free
(
dst_image
->
data
);
SAFE_
free
(
dst_image
->
data
);
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2237,9 +2224,9 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method)
fprintf
(
stderr
,
"******NXPackImage: PANIC! Failed to apply the color mask.
\n
"
);
#endif
free
(
dst_image
->
data
);
SAFE_
free
(
dst_image
->
data
);
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2273,9 +2260,9 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method)
dst_bits_per_pixel
,
dst_packed_bits_per_pixel
);
#endif
free
(
dst_image
->
data
);
SAFE_
free
(
dst_image
->
data
);
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2397,7 +2384,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method)
fprintf
(
stderr
,
"******NXInPlacePackImage: PANIC! Failed to clean the image.
\n
"
);
#endif
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2408,7 +2395,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method)
fprintf
(
stderr
,
"******NXInPlacePackImage: PANIC! Failed to apply the color mask.
\n
"
);
#endif
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2671,7 +2658,7 @@ NXPackedImage *NXEncodeRgb(XImage *src_image, unsigned int method, unsigned int
fprintf
(
stderr
,
"******NXEncodeRgb: PANIC! Rgb compression failed.
\n
"
);
#endif
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2716,7 +2703,7 @@ NXPackedImage *NXEncodeRle(XImage *src_image, unsigned int method, unsigned int
fprintf
(
stderr
,
"******NXEncodeRle: PANIC! Rle compression failed.
\n
"
);
#endif
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2761,7 +2748,7 @@ NXPackedImage *NXEncodeBitmap(XImage *src_image, unsigned int method, unsigned i
fprintf
(
stderr
,
"******NXEncodeBitmap: PANIC! Bitmap compression failed.
\n
"
);
#endif
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2821,7 +2808,7 @@ NXPackedImage *NXEncodeJpeg(XImage *src_image, unsigned int method, unsigned int
fprintf
(
stderr
,
"******NXEncodeJpeg: PANIC! Jpeg compression failed.
\n
"
);
#endif
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -2876,7 +2863,7 @@ NXPackedImage *NXEncodePng(XImage *src_image, unsigned int method, unsigned int
fprintf
(
stderr
,
"******NXEncodePng: PANIC! Png compression failed.
\n
"
);
#endif
free
(
dst_image
);
SAFE_
free
(
dst_image
);
return
NULL
;
}
...
...
@@ -3151,12 +3138,7 @@ void NXInitCache(Display *dpy, int entries)
NXImageCacheSize
=
0
;
if
(
NXImageCache
!=
NULL
)
{
free
(
NXImageCache
);
NXImageCache
=
NULL
;
}
SAFE_free
(
NXImageCache
);
if
(
entries
>
0
)
{
...
...
@@ -3212,7 +3194,7 @@ XImage *NXCacheFindImage(NXPackedImage *src_image, unsigned int *method, unsigne
{
md5_state_t
new_state
;
md5_byte_t
*
new_md5
;
unsigned
int
data_size
,
i
;
unsigned
int
data_size
;
if
(
NXImageCache
==
NULL
)
{
...
...
@@ -3246,7 +3228,7 @@ XImage *NXCacheFindImage(NXPackedImage *src_image, unsigned int *method, unsigne
md5_finish
(
&
new_state
,
new_md5
);
for
(
i
=
0
;
i
<
NXImageCacheSize
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
NXImageCacheSize
;
i
++
)
{
if
(
NXImageCache
[
i
].
image
!=
NULL
)
{
...
...
@@ -3267,7 +3249,7 @@ XImage *NXCacheFindImage(NXPackedImage *src_image, unsigned int *method, unsigne
i
,
NXImageCacheHits
,
NXImageCacheOps
);
#endif
free
(
new_md5
);
SAFE_
free
(
new_md5
);
/*
* Move the images down one slot, from
...
...
@@ -3344,9 +3326,9 @@ int NXCacheAddImage(NXPackedImage *image, unsigned int method, unsigned char *md
i
--
;
free
(
NXImageCache
[
NXImageCacheSize
-
1
].
image
->
data
);
free
(
NXImageCache
[
NXImageCacheSize
-
1
].
image
);
free
(
NXImageCache
[
NXImageCacheSize
-
1
].
md5
);
SAFE_
free
(
NXImageCache
[
NXImageCacheSize
-
1
].
image
->
data
);
SAFE_
free
(
NXImageCache
[
NXImageCacheSize
-
1
].
image
);
SAFE_
free
(
NXImageCache
[
NXImageCacheSize
-
1
].
md5
);
}
if
(
i
>
0
)
...
...
@@ -3400,27 +3382,14 @@ void NXFreeCache(Display *dpy)
{
if
(
NXImageCache
[
i
].
image
!=
NULL
)
{
if
(
NXImageCache
[
i
].
image
->
data
!=
NULL
)
{
free
(
NXImageCache
[
i
].
image
->
data
);
}
free
(
NXImageCache
[
i
].
image
);
NXImageCache
[
i
].
image
=
NULL
;
SAFE_free
(
NXImageCache
[
i
].
image
->
data
);
SAFE_free
(
NXImageCache
[
i
].
image
);
}
if
(
NXImageCache
[
i
].
md5
!=
NULL
)
{
free
(
NXImageCache
[
i
].
md5
);
NXImageCache
[
i
].
md5
=
NULL
;
}
SAFE_free
(
NXImageCache
[
i
].
md5
);
}
free
(
NXImageCache
);
NXImageCache
=
NULL
;
SAFE_free
(
NXImageCache
);
NXImageCacheSize
=
0
;
NXImageCacheHits
=
0
;
...
...
@@ -3490,9 +3459,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf,
DeqAsyncHandler
(
dpy
,
state
->
handler
);
free
(
state
->
handler
);
state
->
handler
=
NULL
;
SAFE_free
(
state
->
handler
);
if
(
rep
->
generic
.
type
==
X_Error
)
{
...
...
@@ -3505,7 +3472,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedImages
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
return
False
;
}
...
...
@@ -3530,7 +3497,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedImages
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
return
False
;
}
...
...
@@ -3553,9 +3520,9 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedImages
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
False
;
}
...
...
@@ -3582,9 +3549,9 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedImages
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
False
;
}
...
...
@@ -3628,10 +3595,10 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedImages
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
free
(
async_head
);
free
(
async_data
);
SAFE_
free
(
async_head
);
SAFE_
free
(
async_data
);
return
True
;
}
...
...
@@ -3651,7 +3618,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf,
_NXNotifyImage
(
dpy
,
state
->
resource
,
True
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
True
;
}
...
...
@@ -3703,7 +3670,7 @@ int NXCollectImage(Display *dpy, unsigned int resource, Drawable drawable,
{
DeqAsyncHandler
(
dpy
,
state
->
handler
);
free
(
state
->
handler
);
SAFE_
free
(
state
->
handler
);
}
if
(
state
->
image
!=
NULL
)
...
...
@@ -3711,7 +3678,7 @@ int NXCollectImage(Display *dpy, unsigned int resource, Drawable drawable,
XDestroyImage
(
state
->
image
);
}
free
(
state
);
SAFE_
free
(
state
);
_NXCollectedImages
[
resource
]
=
NULL
;
}
...
...
@@ -3751,15 +3718,8 @@ int NXCollectImage(Display *dpy, unsigned int resource, Drawable drawable,
UnGetReq
(
GetImage
);
if
(
state
!=
NULL
)
{
free
(
state
);
}
if
(
handler
!=
NULL
)
{
free
(
handler
);
}
SAFE_free
(
state
);
SAFE_free
(
handler
);
UnlockDisplay
(
dpy
);
...
...
@@ -3810,7 +3770,7 @@ int NXGetCollectedImage(Display *dpy, unsigned int resource, XImage **image)
*
image
=
state
->
image
;
free
(
state
);
SAFE_
free
(
state
);
#ifdef TEST
fprintf
(
stderr
,
"******NXGetCollectedImage: Returning GetImage data for resource [%u].
\n
"
,
...
...
@@ -3883,9 +3843,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf,
DeqAsyncHandler
(
dpy
,
state
->
handler
);
free
(
state
->
handler
);
state
->
handler
=
NULL
;
SAFE_free
(
state
->
handler
);
if
(
rep
->
generic
.
type
==
X_Error
)
{
...
...
@@ -3898,7 +3856,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedProperties
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
return
False
;
}
...
...
@@ -3923,7 +3881,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedProperties
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
return
False
;
}
...
...
@@ -3946,9 +3904,9 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedProperties
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
False
;
}
...
...
@@ -3983,9 +3941,9 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedProperties
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
False
;
}
...
...
@@ -4019,16 +3977,14 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf,
_NXNotifyProperty
(
dpy
,
state
->
resource
,
True
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
True
;
}
int
NXGetCollectPropertyResource
(
Display
*
dpy
)
{
int
i
;
for
(
i
=
0
;
i
<
NXNumberOfResources
;
i
++
)
for
(
int
i
=
0
;
i
<
NXNumberOfResources
;
i
++
)
{
if
(
_NXCollectedProperties
[
i
]
==
NULL
)
{
...
...
@@ -4070,15 +4026,11 @@ int NXCollectProperty(Display *dpy, unsigned int resource, Window window, Atom p
{
DeqAsyncHandler
(
dpy
,
state
->
handler
);
free
(
state
->
handler
);
SAFE_
free
(
state
->
handler
);
}
if
(
state
->
data
!=
NULL
)
{
free
(
state
->
data
);
}
free
(
state
);
SAFE_free
(
state
->
data
);
SAFE_free
(
state
);
_NXCollectedProperties
[
resource
]
=
NULL
;
}
...
...
@@ -4115,15 +4067,8 @@ int NXCollectProperty(Display *dpy, unsigned int resource, Window window, Atom p
resource
);
#endif
if
(
state
!=
NULL
)
{
free
(
state
);
}
if
(
handler
!=
NULL
)
{
free
(
handler
);
}
SAFE_free
(
state
);
SAFE_free
(
handler
);
UnGetReq
(
GetProperty
);
...
...
@@ -4183,7 +4128,7 @@ int NXGetCollectedProperty(Display *dpy, unsigned int resource, Atom *actual_typ
*
data
=
(
unsigned
char
*
)
_NXCollectedProperties
[
resource
]
->
data
;
free
(
state
);
SAFE_
free
(
state
);
_NXCollectedProperties
[
resource
]
=
NULL
;
...
...
@@ -4245,9 +4190,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf,
DeqAsyncHandler
(
dpy
,
state
->
handler
);
free
(
state
->
handler
);
state
->
handler
=
NULL
;
SAFE_free
(
state
->
handler
);
if
(
rep
->
generic
.
type
==
X_Error
)
{
...
...
@@ -4260,7 +4203,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedGrabPointers
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
return
False
;
}
...
...
@@ -4285,7 +4228,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedGrabPointers
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
return
False
;
}
...
...
@@ -4308,9 +4251,9 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedGrabPointers
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
False
;
}
...
...
@@ -4324,16 +4267,14 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf,
_NXNotifyGrabPointer
(
dpy
,
state
->
resource
,
True
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
True
;
}
int
NXGetCollectGrabPointerResource
(
Display
*
dpy
)
{
int
i
;
for
(
i
=
0
;
i
<
NXNumberOfResources
;
i
++
)
for
(
int
i
=
0
;
i
<
NXNumberOfResources
;
i
++
)
{
if
(
_NXCollectedGrabPointers
[
i
]
==
NULL
)
{
...
...
@@ -4376,10 +4317,10 @@ int NXCollectGrabPointer(Display *dpy, unsigned int resource, Window grab_window
{
DeqAsyncHandler
(
dpy
,
state
->
handler
);
free
(
state
->
handler
);
SAFE_
free
(
state
->
handler
);
}
free
(
state
);
SAFE_
free
(
state
);
_NXCollectedGrabPointers
[
resource
]
=
NULL
;
}
...
...
@@ -4412,15 +4353,9 @@ int NXCollectGrabPointer(Display *dpy, unsigned int resource, Window grab_window
resource
);
#endif
if
(
state
!=
NULL
)
{
free
(
state
);
}
SAFE_free
(
state
);
if
(
handler
!=
NULL
)
{
free
(
handler
);
}
SAFE_free
(
handler
);
UnGetReq
(
GrabPointer
);
...
...
@@ -4467,7 +4402,7 @@ int NXGetCollectedGrabPointer(Display *dpy, unsigned int resource, int *status)
*
status
=
state
->
status
;
free
(
state
);
SAFE_
free
(
state
);
_NXCollectedGrabPointers
[
resource
]
=
NULL
;
...
...
@@ -4529,9 +4464,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf,
DeqAsyncHandler
(
dpy
,
state
->
handler
);
free
(
state
->
handler
);
state
->
handler
=
NULL
;
SAFE_free
(
state
->
handler
);
if
(
rep
->
generic
.
type
==
X_Error
)
{
...
...
@@ -4544,7 +4477,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedInputFocuses
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
return
False
;
}
...
...
@@ -4569,7 +4502,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedInputFocuses
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
return
False
;
}
...
...
@@ -4592,9 +4525,9 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf,
_NXCollectedInputFocuses
[
state
->
resource
]
=
NULL
;
free
(
state
);
SAFE_
free
(
state
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
False
;
}
...
...
@@ -4610,16 +4543,14 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf,
_NXNotifyInputFocus
(
dpy
,
state
->
resource
,
True
);
free
(
async_head
);
SAFE_
free
(
async_head
);
return
True
;
}
int
NXGetCollectInputFocusResource
(
Display
*
dpy
)
{
int
i
;
for
(
i
=
0
;
i
<
NXNumberOfResources
;
i
++
)
for
(
int
i
=
0
;
i
<
NXNumberOfResources
;
i
++
)
{
if
(
_NXCollectedInputFocuses
[
i
]
==
NULL
)
{
...
...
@@ -4660,10 +4591,10 @@ int NXCollectInputFocus(Display *dpy, unsigned int resource)
{
DeqAsyncHandler
(
dpy
,
state
->
handler
);
free
(
state
->
handler
);
SAFE_
free
(
state
->
handler
);
}
free
(
state
);
SAFE_
free
(
state
);
_NXCollectedInputFocuses
[
resource
]
=
NULL
;
}
...
...
@@ -4687,15 +4618,9 @@ int NXCollectInputFocus(Display *dpy, unsigned int resource)
resource
);
#endif
if
(
state
!=
NULL
)
{
free
(
state
);
}
SAFE_free
(
state
);
if
(
handler
!=
NULL
)
{
free
(
handler
);
}
SAFE_free
(
handler
);
UnGetEmptyReq
();
...
...
@@ -4745,7 +4670,7 @@ int NXGetCollectedInputFocus(Display *dpy, unsigned int resource,
*
focus_return
=
state
->
focus
;
*
revert_to_return
=
state
->
revert_to
;
free
(
state
);
SAFE_
free
(
state
);
_NXCollectedInputFocuses
[
resource
]
=
NULL
;
...
...
@@ -4765,13 +4690,11 @@ void _NXDumpData(const unsigned char *buffer, unsigned int size)
{
unsigned
int
i
=
0
;
unsigned
int
ii
;
while
(
i
<
size
)
{
fprintf
(
stderr
,
"[%d]
\t
"
,
i
);
for
(
ii
=
0
;
i
<
size
&&
ii
<
8
;
i
++
,
ii
++
)
for
(
unsinged
int
ii
=
0
;
i
<
size
&&
ii
<
8
;
i
++
,
ii
++
)
{
fprintf
(
stderr
,
"%d
\t
"
,
(
unsigned
int
)
(
buffer
[
i
]));
}
...
...
nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c
View file @
48b91481
...
...
@@ -38,6 +38,8 @@
#include "Mask.h"
#include "Jpeg.h"
#include "../Utils.h"
#define PANIC
#define WARNING
#undef TEST
...
...
@@ -277,7 +279,7 @@ char *JpegCompressData(XImage *image, int level, int *compressed_size)
jpegError
);
#endif
free
(
jpegCompBuf
);
SAFE_
free
(
jpegCompBuf
);
return
NULL
;
}
...
...
@@ -326,7 +328,7 @@ char *JpegCompressData(XImage *image, int level, int *compressed_size)
jpegDstDataLen
);
#endif
free
(
jpegCompBuf
);
SAFE_
free
(
jpegCompBuf
);
return
NULL
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/compext/Png.c
View file @
48b91481
...
...
@@ -34,6 +34,8 @@
#include "Mask.h"
#include "Png.h"
#include "../Utils.h"
#define PANIC
#define WARNING
#undef TEST
...
...
@@ -361,7 +363,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
#endif
png_destroy_write_struct
(
&
png_ptr
,
&
info_ptr
);
free
(
pngCompBuf
);
SAFE_
free
(
pngCompBuf
);
return
NULL
;
}
...
...
@@ -373,7 +375,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
fprintf
(
stderr
,
"******PngCompressData: PANIC! Could not alloc image_index.
\n
"
);
#endif
free
(
pngCompBuf
);
SAFE_
free
(
pngCompBuf
);
return
NULL
;
}
...
...
@@ -475,8 +477,8 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct
(
&
png_ptr
,
&
info_ptr
);
free
(
pngCompBuf
);
free
(
image_index
);
SAFE_
free
(
pngCompBuf
);
SAFE_
free
(
image_index
);
return
NULL
;
}
...
...
@@ -500,8 +502,8 @@ char *PngCompressData(XImage *image, int *compressed_size)
(
int
)
(
count
*
sizeof
(
CARD8
)));
#endif
free
(
pngCompBuf
);
free
(
image_index
);
SAFE_
free
(
pngCompBuf
);
SAFE_
free
(
image_index
);
return
NULL
;
}
...
...
@@ -532,8 +534,8 @@ char *PngCompressData(XImage *image, int *compressed_size)
dy
,
h
);
#endif
free
(
srcBuf
);
srcBuf
=
NULL
;
free
(
image_index
);
image_index
=
NULL
;
SAFE_free
(
srcBuf
)
;
SAFE_free
(
image_index
)
;
if
(
setjmp
(
png_jmpbuf
(
png_ptr
)))
{
...
...
@@ -543,7 +545,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct
(
&
png_ptr
,
&
info_ptr
);
free
(
pngCompBuf
);
SAFE_
free
(
pngCompBuf
);
return
NULL
;
}
...
...
@@ -594,20 +596,20 @@ char *PngCompressData(XImage *image, int *compressed_size)
pngDataLen
);
#endif
free
(
pngCompBuf
);
SAFE_
free
(
pngCompBuf
);
return
NULL
;
}
}
static
void
PngWriteData
(
png_structp
png_ptr
,
png_bytep
data
,
png_size_t
length
)
static
void
PngWriteData
(
png_structp
_
png_ptr
,
png_bytep
data
,
png_size_t
length
)
{
memcpy
(((
char
*
)
png_get_io_ptr
(
png_ptr
)
+
pngDataLen
),
data
,
length
);
memcpy
(((
char
*
)
png_get_io_ptr
(
_
png_ptr
)
+
pngDataLen
),
data
,
length
);
pngDataLen
+=
length
;
}
static
void
PngFlushData
(
png_structp
png_ptr
)
static
void
PngFlushData
(
png_structp
_
png_ptr
)
{
}
...
...
nx-X11/programs/Xserver/hw/nxagent/compext/Z.c
View file @
48b91481
...
...
@@ -33,6 +33,8 @@
#include "Z.h"
#include "../Utils.h"
#define PANIC
#define WARNING
#undef TEST
...
...
@@ -129,7 +131,7 @@ char *ZCompressData(const char *plainData, unsigned int plainSize, int threshold
plainSize
,
zError
(
result
));
#endif
free
(
compressedData
);
SAFE_
free
(
compressedData
);
*
compressedSize
=
0
;
...
...
@@ -300,7 +302,7 @@ int ZResetEncoder(void)
#endif
}
free
(
zStream
);
SAFE_
free
(
zStream
);
}
zInitialized
=
0
;
...
...
nx-libs.spec
View file @
48b91481
...
...
@@ -473,6 +473,11 @@ rm -r %{buildroot}%{_includedir}/nx-X11/Xtrans
#Remove our shared libraries' .la files before wrapping up the packages
rm %{buildroot}%{_libdir}/*.la
# Fix python scripts
%if 0%{?fedora} >= 23 || 0%{?rhel} >= 8 || 0%{?py_ver} == 3
sed -i '1 s/python/python3/' %{buildroot}%{_bindir}/nxdialog
%endif
%if 0%{?fdupes:1}
%fdupes %{buildroot}%{_prefix}
%endif
...
...
nxcomp/src/Channel.h
View file @
48b91481
...
...
@@ -365,18 +365,18 @@ class Channel
int
handleEncodeIdentity
(
EncodeBuffer
&
encodeBuffer
,
ChannelCache
*
channelCache
,
MessageStore
*
store
,
const
unsigned
char
*
buffer
,
const
unsigned
int
size
,
int
bigEndian
)
const
unsigned
int
size
,
int
_
bigEndian
)
{
return
(
store
->
encodeIdentity
(
encodeBuffer
,
buffer
,
size
,
bigEndian
,
channelCache
));
_
bigEndian
,
channelCache
));
}
int
handleDecodeIdentity
(
DecodeBuffer
&
decodeBuffer
,
ChannelCache
*
channelCache
,
MessageStore
*
store
,
unsigned
char
*&
buffer
,
unsigned
int
&
size
,
int
bigEndian
,
unsigned
int
&
size
,
int
_
bigEndian
,
WriteBuffer
*
writeBuffer
)
{
return
(
store
->
decodeIdentity
(
decodeBuffer
,
buffer
,
size
,
bigEndian
,
return
(
store
->
decodeIdentity
(
decodeBuffer
,
buffer
,
size
,
_
bigEndian
,
writeBuffer
,
channelCache
));
}
...
...
nxcomp/src/Log.h
View file @
48b91481
...
...
@@ -105,7 +105,7 @@ class NXLogStamp
}
NXLogStamp
(
NXLogLevel
level
,
const
char
*
file
=
""
,
const
char
*
function
=
""
,
size_t
line
=
0
)
:
file_
(
file
),
function_
(
function
),
line_
(
line
),
level_
(
level
)
NXLogStamp
(
NXLogLevel
_level
,
const
char
*
_file
=
""
,
const
char
*
_function
=
""
,
size_t
_line
=
0
)
:
file_
(
_file
),
function_
(
_function
),
line_
(
_line
),
level_
(
_
level
)
{
gettimeofday
(
&
timestamp_
,
NULL
);
}
...
...
@@ -300,9 +300,9 @@ class NXLog
return
level_
;
}
void
level
(
NXLogLevel
level
)
void
level
(
NXLogLevel
_
level
)
{
level_
=
level
;
level_
=
_
level
;
}
...
...
@@ -312,9 +312,9 @@ class NXLog
return
get_data
()
->
current_level
;
}
void
current_level
(
NXLogLevel
level
)
void
current_level
(
NXLogLevel
_
level
)
{
get_data
()
->
current_level
=
level
;
get_data
()
->
current_level
=
_
level
;
}
/** Source file from which messages are currently originating */
...
...
@@ -333,10 +333,10 @@ class NXLog
return
stream_
;
}
void
stream
(
std
::
ostream
*
stream
)
void
stream
(
std
::
ostream
*
_
stream
)
{
flush
();
stream_
=
stream
;
stream_
=
_
stream
;
}
bool
synchronized
()
const
{
...
...
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