From 359b557176b9bb2ff1aed2082641eed39c358d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 27 May 2020 14:58:02 +0200 Subject: New upstream version 5.1.2a --- app/wlib/gtklib/window.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'app/wlib/gtklib/window.c') 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); -- cgit v1.2.3