summaryrefslogtreecommitdiff
path: root/desktop/unx
diff options
context:
space:
mode:
authorJosh Heidenreich <josh.sickmate@gmail.com>2011-07-20 14:17:33 +0930
committerJan Holesovsky <kendy@suse.cz>2011-07-20 10:33:12 +0200
commitca9fe5dff457794e55a6bb68633d2a4c2606bd63 (patch)
tree52464341a23ff74e0f9da3ed49b2c0844a9e1b35 /desktop/unx
parentc7f9c1f567736d9ab5e1e10f2260bb5d666db063 (diff)
Splash screen fix for multi-head on Linux (fdo#33214)
Uses xinerama to get the size of the primary screen
Diffstat (limited to 'desktop/unx')
-rwxr-xr-xdesktop/unx/source/makefile.mk6
-rwxr-xr-xdesktop/unx/source/splashx.c23
2 files changed, 29 insertions, 0 deletions
diff --git a/desktop/unx/source/makefile.mk b/desktop/unx/source/makefile.mk
index 2dea54a014b2..7864dd8ad58b 100755
--- a/desktop/unx/source/makefile.mk
+++ b/desktop/unx/source/makefile.mk
@@ -42,6 +42,9 @@ dummy:
CFLAGS+=-DENABLE_QUICKSTART_LIBPNG
CFLAGS+=$(LIBPNG_CFLAGS)
.ENDIF
+.IF "$(USE_XINERAMA)"=="YES"
+CFLAGS+=-DUSE_XINERAMA
+.ENDIF
STDLIB=
@@ -61,6 +64,9 @@ APP1STDLIBS = $(PTHREAD_LIBS) $(X11LINK_DYNAMIC) $(SALLIB)
.IF "$(ENABLE_QUICKSTART_LIBPNG)"=="TRUE"
APP1STDLIBS += $(LIBPNG_LIBS)
.ENDIF
+.IF "$(USE_XINERAMA)"=="YES"
+APP1STDLIBS += -lXinerama
+.ENDIF
.IF "$(OS)"=="SOLARIS"
APP1STDLIBS+= -lsocket
.ENDIF
diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
index c365d4797b58..76ef3eb1f138 100755
--- a/desktop/unx/source/splashx.c
+++ b/desktop/unx/source/splashx.c
@@ -32,6 +32,10 @@
#include <X11/Xatom.h>
#include <X11/Xutil.h>
+#ifdef USE_XINERAMA
+#include <X11/extensions/Xinerama.h>
+#endif
+
#define USE_LIBPNG
#include "osl/endian.h"
@@ -511,6 +515,25 @@ int splash_create_window( int argc, char** argv )
int display_width = DisplayWidth( display, screen );
int display_height = DisplayHeight( display, screen );
+#ifdef USE_XINERAMA
+ int n_xinerama_screens = 1;
+ XineramaScreenInfo* p_screens = XineramaQueryScreens( display, &n_xinerama_screens );
+ if( p_screens )
+ {
+ int i = 0;
+ for( ; i < n_xinerama_screens; i++ )
+ {
+ if ( p_screens[i].screen_number == screen )
+ {
+ display_width = p_screens[i].width;
+ display_height = p_screens[i].height;
+ break;
+ }
+ }
+ XFree( p_screens );
+ }
+#endif
+
win = XCreateSimpleWindow( display, root_win,
( display_width - width ) / 2, ( display_height - height ) / 2,
width, height, 0,