namespace gui::drivers;
import "instance"
-#if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D)
+#if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D) && !defined(ECERE_NOGL)
import "OpenGLDisplayDriver"
#endif
#include <X11/XKBlib.h>
#include <X11/keysym.h>
#include <fcntl.h>
-#if !defined(ECERE_NO3D)
+#if !defined(ECERE_NO3D) && !defined(ECERE_NOGL)
#include <GL/glx.h>
#endif
#include <X11/extensions/Xrender.h>
if(data)
{
int desktops = 0;
- desktops = *(long *)data;
+ desktops = (int)*(long *)data;
//printf("_NET_NUMBER_OF_DESKTOPS is %d\n", desktops);
if(data)
{
- current = *(long *)data;
+ current = (int)*(long *)data;
XFree(data);
data = null;
{
workareas = (long *)data;
- x = workareas[current * 4];
- y = workareas[current * 4 + 1];
- w = workareas[current * 4 + 2];
- h = workareas[current * 4 + 3];
+ x = (int)workareas[current * 4];
+ y = (int)workareas[current * 4 + 1];
+ w = (int)workareas[current * 4 + 2];
+ h = (int)workareas[current * 4 + 3];
//printf("_NET_WORKAREA is x = %d, y = %d, w = %d, h = %d\n", x, y, w, h);
+ XFree(data);
+ data = null;
}
// printf("Work Area width: %d, height %d\n", w, h);
}
*/
if(!buf)
- buf = malloc(bufsize);
+ buf = malloc((uint)bufsize);
if(windowData && windowData.ic)
{
- buflength = XmbLookupString(windowData.ic, event, buf, bufsize, &keysym, &status);
+ buflength = XmbLookupString(windowData.ic, event, buf, (int)bufsize, &keysym, &status);
if (status == XBufferOverflow)
{
- buf = realloc(buf, (bufsize = buflength));
- buflength = XmbLookupString(windowData.ic, event, buf, bufsize, &keysym, &status);
+ buf = realloc(buf, (uint)(bufsize = buflength));
+ buflength = XmbLookupString(windowData.ic, event, buf, (int)bufsize, &keysym, &status);
}
if(status != XLookupKeySym && status != XLookupBoth && release == 1)
keysym = XLookupKeysym(event, 0);
{
XVisualInfo vinfo;
XVisualInfo *vinfo_ret;
- long numitems;
+ int numitems = 0;
vinfo.visualid = XVisualIDFromVisual(xSystemVisual);
vinfo_ret = XGetVisualInfo(xGlobalDisplay, VisualIDMask, &vinfo, &numitems);
event->x_root, event->y_root, &keyFlags, false, false);
delete window;
//*if(xGlobalDisplay) XLockDisplay(xGlobalDisplay);
- lastTime = event->time;
+ lastTime = (uint)event->time;
}
break;
}
//if(event->send_event)
{
X11Window rootChild;
- long rootX, rootY;
+ int rootX, rootY;
XTranslateCoordinates(xGlobalDisplay, event->window,
RootWindow(xGlobalDisplay, DefaultScreen(xGlobalDisplay)), 0, 0,
&rootX, &rootY, &rootChild);
bool laterFocus;
activeWindow = (X11Window)window.windowHandle;
- timeStamp = event->data.l[1];
+ timeStamp = (int)event->data.l[1];
windowData = window.windowData;
laterFocus = windowData.laterFocus;
bool hadFrameExtents = windowData.gotFrameExtents;
windowData.decor =
{
- left = extents[0], right = extents[1],
- top = extents[2], bottom = extents[3]
+ left = (int)extents[0], right = (int)extents[1],
+ top = (int)extents[2], bottom = (int)extents[3]
};
windowData.gotFrameExtents = true;
{
attributes.override_redirect = window.interim ? True : False;
attributes.event_mask = EVENT_MASK;
//printf("%s\n", guiApp.defaultDisplayDriver);
-#if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D)
+#if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D) && !defined(ECERE_NOGL)
if(window.dispDriver == class(OpenGLDisplayDriver) || !strcmp(guiApp.defaultDisplayDriver, "OpenGL"))
{
int samples;
{
XSelectionEvent * selection = (XSelectionEvent *) &e;
//printf("Got a SelectionNotify with %d (%s)\n", selection->_property, XGetAtomName(xGlobalDisplay, selection->_property));
- byte *data;
+ byte *data = null;
unsigned long len, size = 0, dummy;
Atom type;
int format;
XGetWindowProperty(xGlobalDisplay, (X11Window) rootWindow.windowHandle, selection->_property ? selection->_property : atom, 0, 0, False, AnyPropertyType, &type, &format, &len, &size, &data);
+ if(data)
+ {
+ XFree(data);
+ data = null;
+ }
if(size > 0)
{
if(XGetWindowProperty(xGlobalDisplay, (X11Window) rootWindow.windowHandle, selection->_property ? selection->_property : atom, 0, size, False,