Sveinn Sveinsson wrote:This fixes the delayed update.> Peter Bystrom wrote:
>
>>
>> nah, you didn't... I haven't posted about this, except that I have
>> described the problem. try and start paint from the
>> startmenu/accessories under w2k, both with, and without this little
>> hack. if you don't have it the toolbox wont be drawn correctly, if
>> you have it the toolbox will. There's also a problem with the
>> drawing area of paint/paintbrush. rdesktop seems to know it should
>> be white since I can minimize and restore, and it will look ok.
>> These problems seem to be common in many apps, esp, if they are slow
>> drawing themselves. starting the media player under w2k, and you
>> will notice similar artifacts.
>> standing over a toolbar button, like "New" you will sooner or
>> later get a small notice about the button, like "Open a new file" or
>> whatever, that text is usually only drawn halfway, with the last
>> chars skipped. I'm sure they're drawn, it's just that they don't get
>> flushed to screen properly.
>
> I have noticed this delay myself and I think I know where the problem
> lies, just give me a few hours to fix it.
>
> However, if I'm right all the screen artefacts are a different
> problem. My guess is that those are just incorrect translation of
> some rdp orders, which only w2k sends. I can't look at that part of
> the code, since I have limited time available.
>thanks, you have done a lot for this project.
Ah, mmm perhaps I should read a bit about that. it's ok, I'm glad for
all the help we can get, it would be great to get this client working
near to perfect on w2k as well.... ;)
Sorry, I think this is a patch on 18-9, didn't notice you had a newer
one out.
Please, let me know if you have a problem merging it.
Regards,
Svenni.
-- Sveinn Sveinsson | mailto:svenni@strengur.is Strengur ltd Computer Consultants | mailto:ssveinss@informix.com Ármúla 7 | Phone: +354-550-9000 IS-108 Reykjavik | Fax: +354-550-9010 Iceland
diff -Naur rdesktop-patched/Makefile rdesktop-patched2/Makefile
--- rdesktop-patched/Makefile Tue Jan 9 14:08:15 2001
+++ rdesktop-patched2/Makefile Wed Jan 10 11:15:50 2001
@@ -7,6 +7,7 @@
# Uncomment to enable debugging
# DEBUG = -g -DRDP_DEBUG
# DEBUG = -DDEBUG -DX_SYNCED
+# DEBUG = -DDEBUG
# DEBUG = -g -DDEBUG_LEAK
# DEBUG = -p
diff -Naur rdesktop-patched/proto.h rdesktop-patched2/proto.h
--- rdesktop-patched/proto.h Tue Jan 9 14:04:59 2001
+++ rdesktop-patched2/proto.h Wed Jan 10 10:48:30 2001
@@ -89,3 +89,4 @@
void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, int clipx, int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, int bgcolour, int fgcolour, uint8 *text, uint8 length);
void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy);
void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy);
+void ui_sync();
diff -Naur rdesktop-patched/tcp.c rdesktop-patched2/tcp.c
--- rdesktop-patched/tcp.c Tue Jan 9 14:04:59 2001
+++ rdesktop-patched2/tcp.c Wed Jan 10 11:14:05 2001
@@ -31,6 +31,7 @@
static int sock;
static struct stream in;
static struct stream out;
+static int do_ui_sync = 0;
/* Initialise TCP transport data packet */
STREAM tcp_init (int maxlen)
@@ -95,8 +96,15 @@
FD_SET (uisocket, &rfds);
if (uisocket > sock)
maxsocket = uisocket;
- tv.tv_sec = 300;
- tv.tv_usec = 0;
+ if (do_ui_sync) {
+ tv.tv_sec = 0;
+ tv.tv_usec = 100000; // 0.1sec
+ do_ui_sync = 0;
+ }
+ else {
+ tv.tv_sec = 300;
+ tv.tv_usec = 0;
+ }
}
ret = select (maxsocket + 1, &rfds, NULL, NULL, &tv);
@@ -125,8 +133,13 @@
ui_process_events ();
}
}
+ else {
+ DEBUG ("tcp_recv: timeout\n");
+ ui_sync();
+ }
}
+ do_ui_sync = 1;
return ∈
}
diff -Naur rdesktop-patched/xwin.c rdesktop-patched2/xwin.c
--- rdesktop-patched/xwin.c Tue Jan 9 14:04:59 2001
+++ rdesktop-patched2/xwin.c Wed Jan 10 10:56:39 2001
@@ -31,7 +31,7 @@
extern BOOL motion;
extern int bpp;
static int depth = -1;
-static Display *display;
+static Display *display = NULL;
static Window wnd;
static GC gc = NULL;
static GC back_gc = NULL;
@@ -184,6 +184,7 @@
XFreeGC (display, gc);
XDestroyWindow (display, wnd);
XCloseDisplay (display);
+ display = NULL;
}
static uint8
@@ -973,4 +974,11 @@
XPutImage (display, back_pixmap, back_gc, image, 0, 0, x, y, cx, cy);
XFree (image);
+}
+
+void
+ui_sync()
+{
+ if (display != NULL)
+ XFlush(display);
}