summaryrefslogtreecommitdiff
path: root/desktop/unx/source/splashx.c
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2013-10-03 14:51:58 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-10-17 18:44:05 +0000
commit5d4558da5f4b5ee61589fd2b9acaf4eff9b515f5 (patch)
tree39c6fcd35285bfff257f2e7c67cc4aa9ec7d31c3 /desktop/unx/source/splashx.c
parentab5b6e3de4e3eb056e4985cbf2934fbfbfb0ea06 (diff)
fdo#58982 Center the splash screen in dual-monitor setup
The problem was that the position of the screen was not considered. Change-Id: I1b2feb916952a4175bfff0675a884477407a702c Reviewed-on: https://gerrit.libreoffice.org/6119 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'desktop/unx/source/splashx.c')
-rw-r--r--desktop/unx/source/splashx.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
index a154a0651fc9..24b21526cf6f 100644
--- a/desktop/unx/source/splashx.c
+++ b/desktop/unx/source/splashx.c
@@ -425,8 +425,11 @@ static void suppress_decorations(struct splash* splash)
suppress_decorations_motif(splash); // FIXME: Unconditional until Metacity/compiz's SPLASH handling is fixed
}
-// Create the window
-// Return: 1 - success, 0 - failure
+/**
+ * Create the window for the splash screen
+ *
+ * @return Success: 1; Failure: 0
+ */
static int splash_create_window( struct splash* splash, int argc, char** argv )
{
char *display_name = NULL;
@@ -434,6 +437,8 @@ static int splash_create_window( struct splash* splash, int argc, char** argv )
Window root_win;
int display_width = 0;
int display_height = 0;
+ int display_x_pos = 0;
+ int display_y_pos = 0;
unsigned long value_mask = 0;
XGCValues values;
const char* name = "LibreOffice";
@@ -478,13 +483,14 @@ static int splash_create_window( struct splash* splash, int argc, char** argv )
p_screens = XineramaQueryScreens( splash->display, &n_xinerama_screens );
if( p_screens )
{
- int j = 0;
- for( ; j < n_xinerama_screens; j++ )
+ for( i=0; i < n_xinerama_screens; i++ )
{
- if ( p_screens[j].screen_number == splash->screen )
+ if ( p_screens[i].screen_number == splash->screen )
{
- display_width = p_screens[j].width;
- display_height = p_screens[j].height;
+ display_width = p_screens[i].width;
+ display_height = p_screens[i].height;
+ display_x_pos = p_screens[i].x_org;
+ display_y_pos = p_screens[i].y_org;
break;
}
}
@@ -493,7 +499,8 @@ static int splash_create_window( struct splash* splash, int argc, char** argv )
#endif
splash->win = XCreateSimpleWindow( splash->display, root_win,
- ( display_width - splash->width ) / 2, ( display_height - splash->height ) / 2,
+ (display_x_pos + (display_width - splash->width)/2),
+ (display_y_pos + (display_height - splash->height)/2),
splash->width, splash->height, 0,
BlackPixel( splash->display, splash->screen ), BlackPixel( splash->display, splash->screen ) );