diff --git a/kernel/trunk/gui/button.inc b/kernel/trunk/gui/button.inc index 19007614b1..2f8ede35b0 100644 --- a/kernel/trunk/gui/button.inc +++ b/kernel/trunk/gui/button.inc @@ -173,6 +173,11 @@ sys_button: push ecx push edx + or ax,ax + jle noaddbutt + or bx,bx + jle noaddbutt + test ecx,0x40000000 jnz button_no_draw diff --git a/kernel/trunk/gui/skincode.inc b/kernel/trunk/gui/skincode.inc index 0aab25df9e..2a958a39ab 100644 --- a/kernel/trunk/gui/skincode.inc +++ b/kernel/trunk/gui/skincode.inc @@ -56,9 +56,14 @@ load_skin: mov [_skinh],22 mov eax,_skin_file mov edx,skin_data - mov [ebp+SKIN_HEADER.ident],'????' + mov [edx+SKIN_HEADER.ident],'????' call load_skin_file - call parse_skin_data + cmp eax,ERROR_SUCCESS + je @f + cmp eax,ERROR_END_OF_FILE + jne .exit + @@: call parse_skin_data + .exit: popad ret @@ -67,6 +72,12 @@ parse_skin_data: cmp [ebp+SKIN_HEADER.ident],'SKIN' jne .exit + mov edi,skin_udata + mov ecx,(skin_udata.end-skin_udata)/4 + xor eax,eax + cld + rep stosd + mov ebx,[ebp+SKIN_HEADER.params] add ebx,skin_data mov eax,[ebx+SKIN_PARAMS.skin_height] @@ -87,7 +98,6 @@ parse_skin_data: mov edi,common_colours mov ecx,[ebx+SKIN_PARAMS.dtp.size] and ecx,127 - cld rep movsb mov eax,dword[ebx+SKIN_PARAMS.margin.right] mov dword[_skinmargins+0],eax @@ -233,6 +243,19 @@ drawwindow_IV: js no_skin_add_button call draw_rectangle + cmp dword[skin_data],'SKIN' + je @f + xor eax,eax + xor ebx,ebx + mov esi,[esp] + mov ecx,[esi+8] + inc ecx + mov edx,[_skinh] + mov edi,[common_colours+4] ; standard grab color + call [drawbar] + jmp draw_clientbar + @@: + mov esi,[esp] mov eax,[esi+8] ; window width mov edx,[ebp+SKIN_DATA.left.left] @@ -289,6 +312,8 @@ drawwindow_IV: add ecx,[_skinh] call sys_putimage_with_check + draw_clientbar: + mov esi,[esp] mov edx,[esi+04] ; WORK AREA @@ -307,6 +332,9 @@ drawwindow_IV: call [drawbar] _noinside2: + cmp dword[skin_data],'SKIN' + jne no_skin_add_button + ;* close button mov edi,[0xfe88] movzx eax,word [edi] diff --git a/kernel/trunk/gui/skindata.inc b/kernel/trunk/gui/skindata.inc index 3f546e1a94..b7b7c39d55 100644 --- a/kernel/trunk/gui/skindata.inc +++ b/kernel/trunk/gui/skindata.inc @@ -32,6 +32,7 @@ uglobal align 4 +skin_udata: _skinh dd ? _skinmargins rw 4 @@ -44,4 +45,8 @@ align 4 _skin_file rb 256 +align 4 + +skin_udata.end: + endg diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index c099f22ff8..2b33288326 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -316,7 +316,9 @@ display_settings: jne no_com_colours mov [windowtypechanged],dword 1 mov esi,[0x3010] - add esi,[esi+0x10] + add esi,0x10 + add ebx,[esi] + mov esi,ebx mov edi,common_colours and ecx,127 cld