warnings when screen size of depth change and backstore resizeing when screen size changes

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@707 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jay Sorg 2004-06-04 15:01:36 +00:00
parent 115960e2cb
commit 312035fd20
2 changed files with 25 additions and 5 deletions

18
rdp.c
View File

@ -651,11 +651,19 @@ rdp_process_bitmap_caps(STREAM s)
* The server may limit bpp and change the size of the desktop (for * The server may limit bpp and change the size of the desktop (for
* example when shadowing another session). * example when shadowing another session).
*/ */
g_server_bpp = bpp; if (g_server_bpp != bpp)
g_width = width; {
g_height = height; warning("colour depth changed from %d to %d\n", g_server_bpp, bpp);
g_server_bpp = bpp;
ui_resize_window(); }
if (g_width != width || g_height != height)
{
warning("screen size changed from %dx%d to %dx%d\n", g_width, g_height,
width, height);
g_width = width;
g_height = height;
ui_resize_window();
}
} }
/* Respond to a demand active PDU */ /* Respond to a demand active PDU */

12
xwin.c
View File

@ -1031,6 +1031,7 @@ void
ui_resize_window() ui_resize_window()
{ {
XSizeHints *sizehints; XSizeHints *sizehints;
Pixmap bs;
sizehints = XAllocSizeHints(); sizehints = XAllocSizeHints();
if (sizehints) if (sizehints)
@ -1046,6 +1047,17 @@ ui_resize_window()
{ {
XResizeWindow(g_display, g_wnd, g_width, g_height); XResizeWindow(g_display, g_wnd, g_width, g_height);
} }
/* create new backstore pixmap */
if (g_backstore != 0)
{
bs = XCreatePixmap(g_display, g_wnd, g_width, g_height, g_depth);
XSetForeground(g_display, g_gc, BlackPixelOfScreen(g_screen));
XFillRectangle(g_display, bs, g_gc, 0, 0, g_width, g_height);
XCopyArea(g_display, g_backstore, bs, g_gc, 0, 0, g_width, g_height, 0, 0);
XFreePixmap(g_display, g_backstore);
g_backstore = bs;
}
} }
void void