Page 1 of 1

New stack property ignoresMouseEvents

Posted: Thu May 22, 2014 6:14 am
by monte
Hi

One of the windows in Clarify (snapshot countdown) needs to be transparent to mouse events so Trevor has asked me to look into implementing that. On OS X an external solution is working by setting a property of the ignoresMouseEvents of the NSWindow however on Windows I need to modify the WindowProc function to handle WM_NCHITTEST and return HTTRANSPARENT which would need to be an engine change... so can I have some feedback on an ignoresMouseEvents stack property?

Cheers

Monte

Re: New stack property ignoresMouseEvents

Posted: Tue May 27, 2014 10:11 am
by LCMark
@monte: Sounds reasonable to me - ignoreMouseEvents seems a perfectly reasonable name for it, unless anyone can think of a better one :)

Re: New stack property ignoresMouseEvents

Posted: Mon Jun 02, 2014 1:22 am
by monte
I'm looking at this today then. What are your thoughts on the persistence of this property?

Re: New stack property ignoresMouseEvents

Posted: Mon Jun 02, 2014 4:40 am
by monte
Looking at the options for persistence and extended state bit 17 looks like an option. And I'm guessing it should be implemented like modified mark and go via platform window which I think is new since I looked at the engine... I'm forking from develop as my target for release is the 6.7 cycle.

Re: New stack property ignoresMouseEvents

Posted: Mon Jun 02, 2014 5:29 am
by monte
Oh... looks like the platform stuff is only implemented for Mac and I'll need to do different things for other platforms...

Re: New stack property ignoresMouseEvents

Posted: Mon Jun 02, 2014 6:35 am
by monte
Here's the branch for anyone interested to follow/comment: https://github.com/montegoulding/liveco ... ouseEvents

Still to do is test on Windows and document the new property.

Re: New stack property ignoresMouseEvents

Posted: Wed Jun 04, 2014 4:24 am
by monte
Slightly different behavior on Windows where the mouseEvents can only be picked up by underlying windows of the same thread rather than any app. Trying to see if there's any options to make the behavior the same.

Re: New stack property ignoresMouseEvents

Posted: Wed Jun 04, 2014 5:36 am
by monte
I seem to have found a solution by setting the extended style to WS_EX_TRANSPARENT

Re: New stack property ignoresMouseEvents

Posted: Thu Jun 05, 2014 6:32 am
by monte
I've just sent in the pull request. If it could make the next 6.7 dp I'd really appreciate it.

https://github.com/runrev/livecode/pull/814

Re: New stack property ignoresMouseEvents

Posted: Thu Jun 05, 2014 10:02 am
by LCMark
@monte: Good work - I've merged the pull request into develop (via feature-ignore_mouse_events in the RunRev repo) and it will just make 6.7-dp-5. I'm going to ask @runrevfraser to take a look at the branch to see if he can add Linux support (assuming it supports such a mode) if that's okay - might as well see if we can get platform uniformity.

Re: New stack property ignoresMouseEvents

Posted: Mon Jun 09, 2014 7:24 am
by monte
I spent a few minutes googling but nothing jumped out at me so if Fraser can come up with something that would be nice

Re: New stack property ignoresMouseEvents

Posted: Fri Jul 11, 2014 5:29 pm
by LCfraser
I think it should be do-able for Linux.

I'm nearing the completion of porting the Linux windowing code (everything in MCScreenDC, essentially) to use GDK instead of Xlib and have discovered that GDK allows you to set not only a window shape for transparency but also one for input filtering, and the two appear to be settable independently. In other words, it should be possible to specify an empty input mask in order to have all pointer events ignored.

Of course, I've not tried this yet. It will probably turn out not to work how we expect but we can always hope ;)