salvadordf / CEF4Delphi

CEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows, Linux and MacOS.
https://www.briskbard.com/forum/
Other
1.2k stars 365 forks source link

A small problem with MacOS #450

Closed sxmxta closed 1 year ago

sxmxta commented 1 year ago

@salvadordf Hello.

I want to achieve a frameless window area that can be dragged under MacOS. Under Windows, I can use OnRenderCompMsg to observe the mouse area.

But I haven't found a suitable method in MacOS. How can I use similar events in MacOS? NSView.hitTest, I don't know where to use it. Or is there any other way to achieve it?

thank you!

salvadordf commented 1 year ago

Hi,

I'm not a macOS expert and I don't have a Mac, but I would try to use the off-screen rendering mode, also known as "OSR mode".

That mode allows you to use the normal mouse events in the buffer panel : OnMouseMove, OnMouseEnter, OnMouseLeave, OnMouseUp, OnMouseDown, etc.

The Delphi demo for macOS already uses this mode and one of the demos for any OS also use this mode.

Please, use our forum for more questions : https://www.briskbard.com/forum/