xrdp_wm: in multimon scenario, draw log window and login window on

primary monitor
ulab-next-nosound
speidy 9 years ago
parent f31b5a178b
commit 62799b8b10

@ -618,9 +618,15 @@ xrdp_login_wnd_create(struct xrdp_wm *self)
int log_width;
int log_height;
int regular;
int i = 0;
int primaryxoffset = 0;
int primaryyoffset = 0;
globals = &self->xrdp_config->cfg_globals;
primaryxoffset = self->screen->width / 2;
primaryyoffset = self->screen->height / 2;
log_width = globals->ls_width;
log_height = globals->ls_height;
regular = 1;
@ -639,6 +645,20 @@ xrdp_login_wnd_create(struct xrdp_wm *self)
regular = 0;
}
/* multimon scenario, draw login window on primary monitor */
if (self->client_info->monitorCount > 1)
{
for (i = 0; i < self->client_info->monitorCount; ++i)
{
if (self->client_info->minfo[i].is_primary)
{
primaryxoffset = self->screen->width - (self->client_info->minfo[i].right / 2) - 1;
primaryyoffset = self->screen->height - (self->client_info->minfo[i].bottom / 2) - 1;
break;
}
}
}
/* draw login window */
self->login_window = xrdp_bitmap_create(log_width, log_height, self->screen->bpp,
WND_TYPE_WND, self);
@ -647,12 +667,13 @@ xrdp_login_wnd_create(struct xrdp_wm *self)
self->login_window->owner = self->screen;
self->login_window->bg_color = globals->ls_bg_color;
self->login_window->left = self->screen->width / 2 -
self->login_window->width / 2;
self->login_window->left = primaryxoffset -
self->login_window->width / 2;
self->login_window->top = self->screen->height / 2 -
self->login_window->top = primaryyoffset -
self->login_window->height / 2;
self->login_window->notify = xrdp_wm_login_notify;
/* if window title not specified, use hostname as default */

@ -1884,6 +1884,10 @@ xrdp_wm_show_log(struct xrdp_wm *self)
int h;
int xoffset;
int yoffset;
int i;
int primaryxoffset = 0;
int primaryyoffset = 0;
if (self->hide_log_window)
{
@ -1912,6 +1916,20 @@ xrdp_wm_show_log(struct xrdp_wm *self)
yoffset = 2;
}
/* multimon scenario, draw log window on primary monitor */
if (self->client_info->monitorCount > 1)
{
for (i = 0; i < self->client_info->monitorCount; ++i)
{
if (self->client_info->minfo[i].is_primary)
{
primaryxoffset = self->screen->width - self->client_info->minfo[i].right - 1;
primaryyoffset = self->screen->height - self->client_info->minfo[i].bottom - 1;
break;
}
}
}
/* log window */
self->log_wnd = xrdp_bitmap_create(w, h, self->screen->bpp,
WND_TYPE_WND, self);
@ -1919,8 +1937,8 @@ xrdp_wm_show_log(struct xrdp_wm *self)
self->log_wnd->parent = self->screen;
self->log_wnd->owner = self->screen;
self->log_wnd->bg_color = self->grey;
self->log_wnd->left = xoffset;
self->log_wnd->top = yoffset;
self->log_wnd->left = primaryxoffset + xoffset;
self->log_wnd->top = primaryyoffset + yoffset;
set_string(&(self->log_wnd->caption1), "Connection Log");
/* ok button */
but = xrdp_bitmap_create(DEFAULT_BUTTON_W, DEFAULT_BUTTON_H, self->screen->bpp, WND_TYPE_BUTTON, self);

Loading…
Cancel
Save