[Lazarus] Getting X Window handle ?

Kostas Michalopoulos badsectoracula at gmail.com
Mon Nov 5 12:46:25 CET 2012


I'd like such a function myself too, sometimes it is useful to access
the *real* native window regardless of the widgetset you use (GTK, Qt,
Carbon, etc).

On Mon, Nov 5, 2012 at 11:32 AM, zeljko <zeljko at holobit.net> wrote:
> On Monday 05 of November 2012 11:24:41 Michael Van Canneyt wrote:
>> On Mon, 5 Nov 2012, zeljko wrote:
>> > On Monday 05 of November 2012 10:35:45 Michael Van Canneyt wrote:
>> >> Hello,
>> >>
>> >> I'm trying to embed the VLC player (using the videolan DLLS) in a LCL
>> >> application. On Windows, this works fine. On Linux, this does not work.
>> >>
>> >> The reason is that the VideoLan library expects the native window
>> >> handle. On Windows, TWinControl.Handle provides this.
>> >>
>> >> On Linux, TWinControl.Handle returns the GTK widget pointer if I'm using
>> >> GTK. (I imagine it will be something similar when using Qt)
>> >>
>> >> How can I get access to the low-level X window handle (id) of a
>> >> TWinControl on Linux ?
>> >
>> > It's not so problematic. Look at qtx11.inc in lcl/widgetset/qt or in
>> > gtk2widgetset.inc (there's IFDEF X11 or similar) which gets X11 TWindow
>> > from GdkWindow.
>>
>> Actually, it is in gtk2proc, FormToX11Window :-)
>>
>> Thanks.
>>
>> The function could accept a TWinControl instead of TCustomForm I would
>> think. Maybe an overloaded version can be added. The code is the same.
>>
>> I'd even suggest adding a GetNativeHandle : Pointer to TWinControl,
>> but I suspect that will encounter some resistance :-)
>
> Yes, I'm suspicious about it too :)
>
> zeljko
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




More information about the Lazarus mailing list