From f427028551f197cde9d22ed42d741c8662c08f8a Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Mon, 27 May 2013 16:49:46 +0000 Subject: [PATCH] fix some GUI problems highlighted by r3534 git-svn-id: svn://kolibrios.org@3536 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/gui/mouse.inc | 6 +---- kernel/trunk/gui/window.inc | 1 + kernel/trunk/kernel.asm | 44 ++++++++++++++++++++++++++++++------- kernel/trunk/kernel32.inc | 4 +++- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/kernel/trunk/gui/mouse.inc b/kernel/trunk/gui/mouse.inc index a68f0edca9..227b4d17aa 100644 --- a/kernel/trunk/gui/mouse.inc +++ b/kernel/trunk/gui/mouse.inc @@ -66,13 +66,9 @@ mouse_check_events: ;////////////////////////////////////////////////////////// ; NOTE: this code wouldn't be necessary if we knew window did ; already redraw itself after call above or eax, eax - jz @f - - and [mouse.state.buttons], 0 - jmp .exit + jnz .exit ; is there any system button under cursor? - @@: call mouse._.find_sys_button_under_cursor or eax, eax jz .check_buttons_released diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index d37347df33..10360922ba 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -1027,6 +1027,7 @@ align 4 xor eax, eax mov byte[MOUSE_BACKGROUND], al mov byte[DONT_DRAW_MOUSE], al + dec eax ;-------------------------------------- align 4 .exit: diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index dc1fb2ce40..8827217417 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -2839,9 +2839,12 @@ nosb7: cmp ebx, 8 jnz nosb8 - mov eax, [BG_Rect_X_left_right] + mov ecx, [current_slot] + xor eax, eax + xchg eax, [ecx+APPDATA.draw_bgr_x] mov [esp + 32], eax ; eax = [left]*65536 + [right] - mov eax, [BG_Rect_Y_top_bottom] + xor eax, eax + xchg eax, [ecx+APPDATA.draw_bgr_y] mov [esp + 20], eax ; ebx = [top]*65536 + [bottom] ret ;------------------------------------------------------------------------------ @@ -3493,8 +3496,7 @@ mouse_not_active: jz nobackgr ;-------------------------------------- align 4 -@@: - push eax +backgr: mov eax, [draw_data+32 + RECT.left] shl eax, 16 add eax, [draw_data+32 + RECT.right] @@ -3504,7 +3506,6 @@ align 4 shl eax, 16 add eax, [draw_data+32 + RECT.bottom] mov [BG_Rect_Y_top_bottom], eax ; [top]*65536 + [bottom] - pop eax call drawbackground ; DEBUGF 1, "K : drawbackground\n" @@ -3518,15 +3519,42 @@ align 4 align 4 set_bgr_event: add edi, 256 + mov eax, [BG_Rect_X_left_right] + mov edx, [BG_Rect_Y_top_bottom] + cmp [edi+SLOT_BASE+APPDATA.draw_bgr_x], 0 + jz .set +.join: + cmp word [edi+SLOT_BASE+APPDATA.draw_bgr_x+2], ax + jbe @f + mov word [edi+SLOT_BASE+APPDATA.draw_bgr_x+2], ax +@@: + shr eax, 16 + cmp word [edi+SLOT_BASE+APPDATA.draw_bgr_x], ax + jae @f + mov word [edi+SLOT_BASE+APPDATA.draw_bgr_x], ax +@@: + cmp word [edi+SLOT_BASE+APPDATA.draw_bgr_y+2], dx + jbe @f + mov word [edi+SLOT_BASE+APPDATA.draw_bgr_y+2], dx +@@: + shr edx, 16 + cmp word [edi+SLOT_BASE+APPDATA.draw_bgr_y], dx + jae @f + mov word [edi+SLOT_BASE+APPDATA.draw_bgr_y], dx +@@: + jmp .common +.set: + mov [edi+SLOT_BASE+APPDATA.draw_bgr_x], eax + mov [edi+SLOT_BASE+APPDATA.draw_bgr_y], edx +.common: or [edi+SLOT_BASE+APPDATA.event_mask], 10000b ; set event 5 loop set_bgr_event pop edi ecx -; call change_task - because the application must have time to call f.15.8 - call change_task ;--------- set event 5 stop ----------- dec byte[REDRAW_BACKGROUND] ; got new update request? - jnz @b + jnz backgr + xor eax, eax mov [draw_data+32 + RECT.left], eax mov [draw_data+32 + RECT.top], eax mov [draw_data+32 + RECT.right], eax diff --git a/kernel/trunk/kernel32.inc b/kernel/trunk/kernel32.inc index 5d0afb4c7e..7f9338daff 100644 --- a/kernel/trunk/kernel32.inc +++ b/kernel/trunk/kernel32.inc @@ -126,7 +126,9 @@ struct APPDATA tls_base dd ? ;+104 dlls_list_ptr dd ? ;+108 event_filter dd ? ;+112 - rb 12 ;+116 + draw_bgr_x dd ? ;+116 + draw_bgr_y dd ? ;+120 + dd ? ;+124 wnd_shape dd ? ;+128 wnd_shape_scale dd ? ;+132