New stack property ignoresMouseEvents

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

Locked
monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

New stack property ignoresMouseEvents

Post by monte » Thu May 22, 2014 6:14 am

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
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: New stack property ignoresMouseEvents

Post by LCMark » Tue May 27, 2014 10:11 am

@monte: Sounds reasonable to me - ignoreMouseEvents seems a perfectly reasonable name for it, unless anyone can think of a better one :)

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: New stack property ignoresMouseEvents

Post by monte » Mon Jun 02, 2014 1:22 am

I'm looking at this today then. What are your thoughts on the persistence of this property?
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: New stack property ignoresMouseEvents

Post by monte » Mon Jun 02, 2014 4:40 am

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.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: New stack property ignoresMouseEvents

Post by monte » Mon Jun 02, 2014 5:29 am

Oh... looks like the platform stuff is only implemented for Mac and I'll need to do different things for other platforms...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: New stack property ignoresMouseEvents

Post by monte » Mon Jun 02, 2014 6:35 am

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.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: New stack property ignoresMouseEvents

Post by monte » Wed Jun 04, 2014 4:24 am

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.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: New stack property ignoresMouseEvents

Post by monte » Wed Jun 04, 2014 5:36 am

I seem to have found a solution by setting the extended style to WS_EX_TRANSPARENT
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: New stack property ignoresMouseEvents

Post by monte » Thu Jun 05, 2014 6:32 am

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
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: New stack property ignoresMouseEvents

Post by LCMark » Thu Jun 05, 2014 10:02 am

@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.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: New stack property ignoresMouseEvents

Post by monte » Mon Jun 09, 2014 7:24 am

I spent a few minutes googling but nothing jumped out at me so if Fraser can come up with something that would be nice
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCfraser
Livecode Staff Member
Livecode Staff Member
Posts: 71
Joined: Thu Nov 28, 2013 11:18 am
Contact:

Re: New stack property ignoresMouseEvents

Post by LCfraser » Fri Jul 11, 2014 5:29 pm

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 ;)

Locked

Return to “Engine Contributors”