From 5a795de357b5b9bd5a79ea2d24d25a6bbb146f0b Mon Sep 17 00:00:00 2001 From: GerdtR Date: Sat, 31 Oct 2015 21:43:10 +0000 Subject: [PATCH] Remove unnecessary redrawing windows. git-svn-id: svn://kolibrios.org@5870 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/gui/mouse.inc | 19 +++++++++++++++++++ kernel/trunk/gui/window.inc | 14 +++++++++----- kernel/trunk/kernel.asm | 8 ++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/kernel/trunk/gui/mouse.inc b/kernel/trunk/gui/mouse.inc index 9a9092fc68..595f8ee974 100644 --- a/kernel/trunk/gui/mouse.inc +++ b/kernel/trunk/gui/mouse.inc @@ -187,6 +187,11 @@ uglobal .action db ? endg +iglobal + fl_moving db 0 + rb 3 +endg + align 4 ;----------------------------------------------------------------- mouse._.left_button_press_handler: @@ -306,6 +311,7 @@ mouse._.left_button_release_handler: .exit: and [mouse.active_sys_window.action], 0 + mov [fl_moving], 0 ret mouse._.right_button_press_handler: @@ -480,6 +486,19 @@ mouse._.move_handler: pop esi je .exit + test [fl_moving], 1 + jnz @f + + mov [fl_moving], 1 + push edi + mov edi, esi + shl edi, 5 + add edi, WDATA.box + window_data + call window._.draw_negative_box + pop edi + @@: + + mov [mouse.active_sys_window.last_ticks], 0 call sys_window_moving_handler diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index 99eed83922..6286228ab2 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -1386,6 +1386,15 @@ sys_window_end_moving_handler: ;/////////////////////////////////////////////// shl edi, 5 add edi, window_data + test [fl_moving], 1 + jz @f + + push edi + mov edi, ebx + call window._.draw_negative_box + pop edi + @@: + mov eax, ebx mov bl, [edi + WDATA.fl_wstate] call window._.set_window_box @@ -1523,11 +1532,6 @@ end if call memmove mov eax, ebx mov ebx, esi - - push edi - mov edi, eax - call window._.draw_negative_box - pop edi call window._.check_window_position call window._.set_window_clientbox call window._.invalidate_screen diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index ce2ae5a8ba..249080cc37 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -3841,6 +3841,14 @@ newdw2: cmp ecx, 1 ; limit for background jz bgli + mov eax, [esp+4] ;if upper in z-position - no redraw + test eax, eax + jz @f + mov al, [eax + WDATA.z_modif] + cmp [edi + WDATA.z_modif], al + jg ricino + @@: + mov eax, [edi + WDATA.box.left] mov ebx, [edi + WDATA.box.top]