Unverified Commit 48b91481 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/various5' into 3.6.x

parents 6cd4f123 252b86ee
...@@ -601,8 +601,8 @@ extern Bool CreateConnectionBlock(void); ...@@ -601,8 +601,8 @@ extern Bool CreateConnectionBlock(void);
Bool PanoramiXCreateConnectionBlock(void) Bool PanoramiXCreateConnectionBlock(void)
{ {
int i, j, length; int i, j, length;
Bool disableBackingStore = FALSE; Bool disable_backing_store = FALSE;
Bool disableSaveUnders = FALSE; Bool disable_save_unders = FALSE;
int old_width, old_height; int old_width, old_height;
float width_mult, height_mult; float width_mult, height_mult;
xWindowRoot *root; xWindowRoot *root;
...@@ -627,17 +627,17 @@ Bool PanoramiXCreateConnectionBlock(void) ...@@ -627,17 +627,17 @@ Bool PanoramiXCreateConnectionBlock(void)
return FALSE; return FALSE;
} }
if(pScreen->backingStoreSupport != screenInfo.screens[0]->backingStoreSupport) if(pScreen->backingStoreSupport != screenInfo.screens[0]->backingStoreSupport)
disableBackingStore = TRUE; disable_backing_store = TRUE;
if(pScreen->saveUnderSupport != screenInfo.screens[0]->saveUnderSupport) if(pScreen->saveUnderSupport != screenInfo.screens[0]->saveUnderSupport)
disableSaveUnders = TRUE; disable_save_unders = TRUE;
} }
if(disableBackingStore || disableSaveUnders) { if(disable_backing_store || disable_save_unders) {
for(i = 0; i < screenInfo.numScreens; i++) { for(i = 0; i < screenInfo.numScreens; i++) {
pScreen = screenInfo.screens[i]; pScreen = screenInfo.screens[i];
if(disableBackingStore) if(disable_backing_store)
pScreen->backingStoreSupport = NotUseful; pScreen->backingStoreSupport = NotUseful;
if(disableSaveUnders) if(disable_save_unders)
pScreen->saveUnderSupport = NotUseful; pScreen->saveUnderSupport = NotUseful;
} }
} }
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include "Display.h" #include "Display.h"
#include "Screen.h" #include "Screen.h"
#include "Options.h" #include "Options.h"
#include "Agent.h"
#include "Utils.h" #include "Utils.h"
/* /*
...@@ -709,7 +708,7 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local) ...@@ -709,7 +708,7 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local)
if (current->string) if (current->string)
fprintf(stderr, "%s: local [%d] -> remote [%d (%s)]\n", __func__, local, current->remote, current->string); fprintf(stderr, "%s: local [%d] -> remote [%d (%s)]\n", __func__, local, current->remote, current->string);
else 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 #endif
return current->remote; return current->remote;
...@@ -718,7 +717,7 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local) ...@@ -718,7 +717,7 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local)
{ {
const char *string = NameForAtom(local); const char *string = NameForAtom(local);
/* FIXME: why False? */ /* False means "create Atom if it does not exist yet" */
XlibAtom remote = XInternAtom(nxagentDisplay, string, False); XlibAtom remote = XInternAtom(nxagentDisplay, string, False);
if (remote == None) if (remote == None)
......
...@@ -292,7 +292,7 @@ static void printSelectionStat(int sel) ...@@ -292,7 +292,7 @@ static void printSelectionStat(int sel)
#else #else
fprintf(stderr, " CurrentSelections[].client [%p] index [%d]\n", fprintf(stderr, " CurrentSelections[].client [%p] index [%d]\n",
(void *)curSel.client, (void *)curSel.client,
CLINDEX(curSel.client); CLINDEX(curSel.client));
#endif #endif
fprintf(stderr, " CurrentSelections[].window [0x%x]\n", curSel.window); fprintf(stderr, " CurrentSelections[].window [0x%x]\n", curSel.window);
return; return;
...@@ -1937,17 +1937,23 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1937,17 +1937,23 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
*/ */
XlibAtom p = serverTransToAgentProperty; XlibAtom p = serverTransToAgentProperty;
XlibAtom t; XlibAtom t;
#ifdef DEBUG
char * pstr = "NX_CUT_BUFFER_SERVER"; char * pstr = "NX_CUT_BUFFER_SERVER";
const char * tstr; const char * tstr;
#endif
if (target == clientUTF8_STRING) if (target == clientUTF8_STRING)
{ {
t = serverUTF8_STRING; t = serverUTF8_STRING;
#ifdef DEBUG
tstr = szAgentUTF8_STRING; tstr = szAgentUTF8_STRING;
#endif
} }
else else
{ {
t = XA_STRING; t = XA_STRING;
#ifdef DEBUG
tstr = validateString(NameForAtom(XA_STRING)); tstr = validateString(NameForAtom(XA_STRING));
#endif
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -2025,11 +2031,12 @@ int nxagentSendNotify(xEvent *event) ...@@ -2025,11 +2031,12 @@ int nxagentSendNotify(xEvent *event)
* communication happens completely between our own clients (some of * communication happens completely between our own clients (some of
* which can be nxagents themselves). In that case we return 0 (tell * which can be nxagents themselves). In that case we return 0 (tell
* dix to go on) and do nothing! * 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 #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 #endif
return 0; return 0;
} }
......
...@@ -2851,10 +2851,10 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) ...@@ -2851,10 +2851,10 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X)
fprintf(stderr, "%s: Handling event.\n", __func__); fprintf(stderr, "%s: Handling event.\n", __func__);
#endif #endif
Atom local = nxagentRemoteToLocalAtom(xfixesEvent -> xfixesselection.selection);
if (SelectionCallback) if (SelectionCallback)
{ {
Atom local = nxagentRemoteToLocalAtom(xfixesEvent -> xfixesselection.selection);
int i = nxagentFindCurrentSelectionIndex(local); int i = nxagentFindCurrentSelectionIndex(local);
if (i < NumCurrentSelections) if (i < NumCurrentSelections)
{ {
......
...@@ -42,7 +42,7 @@ is" without express or implied warranty. ...@@ -42,7 +42,7 @@ is" without express or implied warranty.
extern RESTYPE RT_NX_GC; extern RESTYPE RT_NX_GC;
/* This file uses the GC definition form Xlib.h as XlibGC. */ /* This file uses the GC definition from Xlib.h as XlibGC. */
typedef struct { typedef struct {
XlibGC gc; XlibGC gc;
......
...@@ -341,7 +341,7 @@ void nxagentMaximizeToFullScreen(ScreenPtr pScreen) ...@@ -341,7 +341,7 @@ void nxagentMaximizeToFullScreen(ScreenPtr pScreen)
XUnmapWindow(nxagentDisplay, nxagentIconWindow); 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 FIXME: We'll check for ReparentNotify and LeaveNotify events after
...@@ -351,55 +351,55 @@ 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. 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)) if (!nxagentIsParentOf(nxagentDisplay, root, nxagentFullscreenWindow))
{ {
XReparentWindow(nxagentDisplay, nxagentFullscreenWindow, XReparentWindow(nxagentDisplay, nxagentFullscreenWindow,
root, 0, 0); root, 0, 0);
for (int i = 0; i < 100 && nxagentWMIsRunning; i++) for (int i = 0; i < 100 && nxagentWMIsRunning; i++)
{ {
XEvent e; XEvent e;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event [%d].\n", i); fprintf(stderr, "nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event [%d].\n", i);
#endif #endif
if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e)) if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e))
{ {
break; break;
} }
XSync(nxagentDisplay, 0); XSync(nxagentDisplay, 0);
nxagentWaitEvents(nxagentDisplay, 50); nxagentWaitEvents(nxagentDisplay, 50);
}
}
else
{
#ifdef TEST
fprintf(stderr, "%s: FullscreenWindow already is child of root window - skipping reparenting,\n", __func__);
#endif
} }
}
else
{
#ifdef TEST
fprintf(stderr, "%s: FullscreenWindow already is child of root window - skipping reparenting,\n", __func__);
#endif
}
XMapRaised(nxagentDisplay, nxagentFullscreenWindow); XMapRaised(nxagentDisplay, nxagentFullscreenWindow);
XIconifyWindow(nxagentDisplay, nxagentIconWindow, XIconifyWindow(nxagentDisplay, nxagentIconWindow,
DefaultScreen(nxagentDisplay)); DefaultScreen(nxagentDisplay));
/* swallow all LeaveNotify events for the FullscreenWindow; /* swallow all LeaveNotify events for the FullscreenWindow;
Normally this does not swallow anything these days, but when Normally this does not swallow anything these days, but when
using fvwm you see one of these events here. */ using fvwm you see one of these events here. */
while (1) while (1)
{ {
XEvent e; XEvent e;
if (!XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, LeaveNotify, &e)) if (!XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, LeaveNotify, &e))
break; break;
#ifdef TEST #ifdef TEST
fprintf(stderr, "%s: swallowing LeaveNotify event\n", __func__); fprintf(stderr, "%s: swallowing LeaveNotify event\n", __func__);
#endif #endif
} }
/* /*
XMapWindow(nxagentDisplay, nxagentIconWindow); XMapWindow(nxagentDisplay, nxagentIconWindow);
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include "Mask.h" #include "Mask.h"
#include "Jpeg.h" #include "Jpeg.h"
#include "../Utils.h"
#define PANIC #define PANIC
#define WARNING #define WARNING
#undef TEST #undef TEST
...@@ -277,7 +279,7 @@ char *JpegCompressData(XImage *image, int level, int *compressed_size) ...@@ -277,7 +279,7 @@ char *JpegCompressData(XImage *image, int level, int *compressed_size)
jpegError); jpegError);
#endif #endif
free(jpegCompBuf); SAFE_free(jpegCompBuf);
return NULL; return NULL;
} }
...@@ -326,7 +328,7 @@ char *JpegCompressData(XImage *image, int level, int *compressed_size) ...@@ -326,7 +328,7 @@ char *JpegCompressData(XImage *image, int level, int *compressed_size)
jpegDstDataLen); jpegDstDataLen);
#endif #endif
free(jpegCompBuf); SAFE_free(jpegCompBuf);
return NULL; return NULL;
} }
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include "Mask.h" #include "Mask.h"
#include "Png.h" #include "Png.h"
#include "../Utils.h"
#define PANIC #define PANIC
#define WARNING #define WARNING
#undef TEST #undef TEST
...@@ -361,7 +363,7 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -361,7 +363,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
#endif #endif
png_destroy_write_struct(&png_ptr, &info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr);
free(pngCompBuf); SAFE_free(pngCompBuf);
return NULL; return NULL;
} }
...@@ -373,7 +375,7 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -373,7 +375,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
fprintf(stderr, "******PngCompressData: PANIC! Could not alloc image_index.\n"); fprintf(stderr, "******PngCompressData: PANIC! Could not alloc image_index.\n");
#endif #endif
free(pngCompBuf); SAFE_free(pngCompBuf);
return NULL; return NULL;
} }
...@@ -475,8 +477,8 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -475,8 +477,8 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct(&png_ptr, &info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr);
free(pngCompBuf); SAFE_free(pngCompBuf);
free(image_index); SAFE_free(image_index);
return NULL; return NULL;
} }
...@@ -500,8 +502,8 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -500,8 +502,8 @@ char *PngCompressData(XImage *image, int *compressed_size)
(int) (count * sizeof(CARD8))); (int) (count * sizeof(CARD8)));
#endif #endif
free(pngCompBuf); SAFE_free(pngCompBuf);
free(image_index); SAFE_free(image_index);
return NULL; return NULL;
} }
...@@ -532,8 +534,8 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -532,8 +534,8 @@ char *PngCompressData(XImage *image, int *compressed_size)
dy, h); dy, h);
#endif #endif
free(srcBuf); srcBuf = NULL; SAFE_free(srcBuf);
free(image_index); image_index = NULL; SAFE_free(image_index);
if (setjmp(png_jmpbuf(png_ptr))) if (setjmp(png_jmpbuf(png_ptr)))
{ {
...@@ -543,7 +545,7 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -543,7 +545,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct(&png_ptr, &info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr);
free(pngCompBuf); SAFE_free(pngCompBuf);
return NULL; return NULL;
} }
...@@ -594,20 +596,20 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -594,20 +596,20 @@ char *PngCompressData(XImage *image, int *compressed_size)
pngDataLen); pngDataLen);
#endif #endif
free(pngCompBuf); SAFE_free(pngCompBuf);
return NULL; 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; pngDataLen += length;
} }
static void PngFlushData(png_structp png_ptr) static void PngFlushData(png_structp _png_ptr)
{ {
} }
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include "Z.h" #include "Z.h"
#include "../Utils.h"
#define PANIC #define PANIC
#define WARNING #define WARNING
#undef TEST #undef TEST
...@@ -129,7 +131,7 @@ char *ZCompressData(const char *plainData, unsigned int plainSize, int threshold ...@@ -129,7 +131,7 @@ char *ZCompressData(const char *plainData, unsigned int plainSize, int threshold
plainSize, zError(result)); plainSize, zError(result));
#endif #endif
free(compressedData); SAFE_free(compressedData);
*compressedSize = 0; *compressedSize = 0;
...@@ -300,7 +302,7 @@ int ZResetEncoder(void) ...@@ -300,7 +302,7 @@ int ZResetEncoder(void)
#endif #endif
} }
free(zStream); SAFE_free(zStream);
} }
zInitialized = 0; zInitialized = 0;
......
...@@ -473,6 +473,11 @@ rm -r %{buildroot}%{_includedir}/nx-X11/Xtrans ...@@ -473,6 +473,11 @@ rm -r %{buildroot}%{_includedir}/nx-X11/Xtrans
#Remove our shared libraries' .la files before wrapping up the packages #Remove our shared libraries' .la files before wrapping up the packages
rm %{buildroot}%{_libdir}/*.la 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} %if 0%{?fdupes:1}
%fdupes %{buildroot}%{_prefix} %fdupes %{buildroot}%{_prefix}
%endif %endif
......
...@@ -365,18 +365,18 @@ class Channel ...@@ -365,18 +365,18 @@ class Channel
int handleEncodeIdentity(EncodeBuffer &encodeBuffer, ChannelCache *channelCache, int handleEncodeIdentity(EncodeBuffer &encodeBuffer, ChannelCache *channelCache,
MessageStore *store, const unsigned char *buffer, MessageStore *store, const unsigned char *buffer,
const unsigned int size, int bigEndian) const unsigned int size, int _bigEndian)
{ {
return (store -> encodeIdentity(encodeBuffer, buffer, size, return (store -> encodeIdentity(encodeBuffer, buffer, size,
bigEndian, channelCache)); _bigEndian, channelCache));
} }
int handleDecodeIdentity(DecodeBuffer &decodeBuffer, ChannelCache *channelCache, int handleDecodeIdentity(DecodeBuffer &decodeBuffer, ChannelCache *channelCache,
MessageStore *store, unsigned char *&buffer, MessageStore *store, unsigned char *&buffer,
unsigned int &size, int bigEndian, unsigned int &size, int _bigEndian,
WriteBuffer *writeBuffer) WriteBuffer *writeBuffer)
{ {
return (store -> decodeIdentity(decodeBuffer, buffer, size, bigEndian, return (store -> decodeIdentity(decodeBuffer, buffer, size, _bigEndian,
writeBuffer, channelCache)); writeBuffer, channelCache));
} }
......
...@@ -105,7 +105,7 @@ class NXLogStamp ...@@ -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); gettimeofday(&timestamp_, NULL);
} }
...@@ -300,9 +300,9 @@ class NXLog ...@@ -300,9 +300,9 @@ class NXLog
return level_; return level_;
} }
void level(NXLogLevel level) void level(NXLogLevel _level)
{ {
level_ = level; level_ = _level;
} }
...@@ -312,9 +312,9 @@ class NXLog ...@@ -312,9 +312,9 @@ class NXLog
return get_data()->current_level; 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 */ /** Source file from which messages are currently originating */
...@@ -333,10 +333,10 @@ class NXLog ...@@ -333,10 +333,10 @@ class NXLog
return stream_; return stream_;
} }
void stream(std::ostream *stream) void stream(std::ostream *_stream)
{ {
flush(); flush();
stream_ = stream; stream_ = _stream;
} }
bool synchronized() const { bool synchronized() const {
......
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