summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/window.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-05-27 14:58:02 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-05-27 14:58:02 +0200
commit359b557176b9bb2ff1aed2082641eed39c358d0d (patch)
treef6c2baca2e6a5d06b7bf32e48e475a6b7b1ea262 /app/wlib/gtklib/window.c
parent9a1d6eded2750572e9f5f79e53ec507dd7a06ba5 (diff)
New upstream version 5.1.2aupstream/5.1.2a
Diffstat (limited to 'app/wlib/gtklib/window.c')
-rw-r--r--app/wlib/gtklib/window.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/app/wlib/gtklib/window.c b/app/wlib/gtklib/window.c
index 2470382..49770c5 100644
--- a/app/wlib/gtklib/window.c
+++ b/app/wlib/gtklib/window.c
@@ -591,7 +591,7 @@ static gint window_delete_event(
}
if (win->winProc) {
- win->winProc(win, wClose_e, win->data);
+ win->winProc(win, wClose_e, NULL, win->data);
if (win != gtkMainW) {
wWinShow(win, FALSE);
@@ -616,11 +616,22 @@ static int fixed_expose_event(
static int resizeTime(wWin_p win) {
if (win->resizeW == win->w && win->resizeH == win->h) { // If hasn't changed since last
- win->resizeTimer = 0;
- return FALSE; //Stop Timer and don't resize
+ if (win->timer_idle_count>3) {
+ win->winProc(win, wResize_e, NULL, win->data); //Trigger Redraw on last occasion if one-third of a second has elapsed
+ win->timer_idle_count = 0;
+ win->resizeTimer = 0;
+ win->timer_busy_count = 0;
+ return FALSE; //Stop Timer and don't resize
+ } else win->timer_idle_count++;
}
if (win->busy==FALSE && win->winProc) { //Always drive once
- win->winProc(win, wResize_e, win->data);
+ if (win->timer_busy_count>10) {
+ win->winProc(win, wResize_e, NULL, win->data); //Redraw if ten times we saw a change (1 sec)
+ win->timer_busy_count = 0;
+ } else {
+ win->winProc(win, wResize_e, (void*) 1, win->data); //No Redraw
+ win->timer_busy_count++;
+ }
win->resizeW = win->w; //Remember this one
win->resizeH = win->h;
}
@@ -668,7 +679,9 @@ static int window_configure_event(
} else {
win->resizeW = w; //Remember where this started
win->resizeH = h;
- win->resizeTimer = g_timeout_add(200,(GSourceFunc)resizeTime,win); // 200ms delay
+ win->timer_idle_count = 0; //Start background timer on redraw
+ win->timer_busy_count = 0;
+ win->resizeTimer = g_timeout_add(100,(GSourceFunc)resizeTime,win); // 100ms delay
return FALSE;
}
}
@@ -704,7 +717,7 @@ gboolean window_state_event(
}
if (win->busy==FALSE && win->winProc) {
- win->winProc(win, wState_e, win->data);
+ win->winProc(win, wState_e, NULL, win->data);
}
return TRUE;
@@ -1079,7 +1092,7 @@ void wExit(
wPrefFlush();
if (gtkMainW && gtkMainW->winProc != NULL) {
- gtkMainW->winProc(gtkMainW, wQuit_e, gtkMainW->data);
+ gtkMainW->winProc(gtkMainW, wQuit_e, NULL, gtkMainW->data);
}
exit(rc);