Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/working-area.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@
*/

# include <gdk/gdk.h>

#ifdef GDK_WINDOWING_X11
# include <gdk/gdkx.h>
# include <X11/Xlib.h>
# include <X11/Xutil.h>
# include <X11/Xatom.h>
#endif

void get_working_area(GdkScreen* screen, GdkRectangle *rect);

static gboolean gf_display_get_workarea(GdkScreen* g_screen, GdkRectangle *rect) {
#ifndef GDK_WINDOWING_X11
return FALSE;
#else
Atom xa_desktops, xa_current, xa_workarea, xa_type;
Display *x_display;
Window x_root;
Expand All @@ -47,6 +53,11 @@ static gboolean gf_display_get_workarea(GdkScreen* g_screen, GdkRectangle *rect)
if(!g_display)
return FALSE;

#if defined(GDK_IS_X11_DISPLAY) && defined(GDK_IS_X11_SCREEN)
if(!GDK_IS_X11_DISPLAY(g_display) || !GDK_IS_X11_SCREEN(g_screen))
return FALSE;
Comment thread
slowriot marked this conversation as resolved.
#endif

/* get the x display from the gdk display */
x_display = gdk_x11_display_get_xdisplay(g_display);
if(!x_display)
Expand Down Expand Up @@ -134,6 +145,7 @@ static gboolean gf_display_get_workarea(GdkScreen* g_screen, GdkRectangle *rect)
XFree(data);

return TRUE;
#endif
}

void get_working_area(GdkScreen* screen, GdkRectangle *rect)
Expand Down