diff --git a/lcl/interfaces/cocoa/cocoautils.pas b/lcl/interfaces/cocoa/cocoautils.pas index 43bf940323..a3d1a04ede 100644 --- a/lcl/interfaces/cocoa/cocoautils.pas +++ b/lcl/interfaces/cocoa/cocoautils.pas @@ -164,6 +164,7 @@ begin Result := 0 else begin + Result := 0; // getting rid of compiler warning for y := 0 to ImageRep.pixelsHigh - 1 do for x := 0 to ImageRep.pixelsWide - 1 do begin diff --git a/lcl/interfaces/cocoa/cocoawinapi.inc b/lcl/interfaces/cocoa/cocoawinapi.inc index 23365c7d9d..834919bbf2 100644 --- a/lcl/interfaces/cocoa/cocoawinapi.inc +++ b/lcl/interfaces/cocoa/cocoawinapi.inc @@ -2089,6 +2089,7 @@ var lView: NSView; begin Obj := NSObject(Handle); + Result := 0; // should return 0, if function fails if Assigned(Obj) and NSApp.isActive then begin Result := HWND(NSApp.keyWindow); @@ -2098,9 +2099,7 @@ begin begin lView := GetNSObjectView(Obj); if lView <> nil then - lView.window.makeKeyWindow - else - Result := 0; + lView.window.makeKeyWindow; end; end; end; diff --git a/lcl/interfaces/cocoa/cocoawindows.pas b/lcl/interfaces/cocoa/cocoawindows.pas index f40c7fb3b7..2152632a18 100644 --- a/lcl/interfaces/cocoa/cocoawindows.pas +++ b/lcl/interfaces/cocoa/cocoawindows.pas @@ -1138,6 +1138,8 @@ begin // the window doesn't have screen assigned. // figuring out the placement based of the Left/Top of the rect // and NSrects; + fnd := false; + srect := NSMakeRect(0,0,0,0); // making the compiler happy p.x:=r.Left; p.y:=r.Top; for sc in NSScreen.screens do begin diff --git a/lcl/interfaces/cocoa/cocoawscommon.pas b/lcl/interfaces/cocoa/cocoawscommon.pas index 1f29ecf32e..018125dedb 100644 --- a/lcl/interfaces/cocoa/cocoawscommon.pas +++ b/lcl/interfaces/cocoa/cocoawscommon.pas @@ -784,6 +784,10 @@ begin SendChar := False; VKKeyCode := VK_UNKNOWN; + UTF8Character := ''; + KeyChar := #0; + VKKeyChar := #0; + IsSysKey := (Event.modifierFlags and NSCommandKeyMask) <> 0; KeyData := (Ord(Event.isARepeat) + 1) or Event.keyCode shl 16; if (Event.modifierFlags and NSAlternateKeyMask) <> 0 then @@ -934,8 +938,6 @@ begin end; procedure TLCLCommonCallback.KeyEvBeforeDown(var AllowCocoaHandle: boolean); -var - OrigChar: AnsiString; begin // create the CN_KEYDOWN message if _IsSysKey then @@ -979,7 +981,6 @@ begin // send the UTF8 keypress - OrigChar := _UTF8Character; if Target.IntfUTF8KeyPress(_UTF8Character, 1, _IsSysKey) then begin // the LCL has handled the key