Xpra: Ticket #1401: A function to clear video region detection, rather than setting to 0 coordinates and hoping for the best, might come in handy

We're often detecting for video regions, but not quite certain of the best way to indicate to the server that we've no longer got video regions being detected, and that we thusly need the server to go back to using fresh heuristics, rather than continuing to 'wait and see' about those that might otherwise be 'up in the air'.

I'm assuming a control channel would be worthwhile, but a dbus call would be especially useful.



Sat, 07 Jan 2017 11:27:43 GMT - Antoine Martin: owner, summary changed

Done in r14724 + r14727 fixup, you can reset the video region heuristics using:

This will reset everything except for the exclude regions list.


Tue, 10 Jan 2017 00:19:11 GMT - J. Max Mena: owner changed

Did some testing with a trunk Fedora 25 r14735 server and client (two machines, same software versions):

Both the Control Channel and DBUS interfaces work with an important caveat -the control reset-video-region turns video detection back on whereas the DBUS equivalent does not.

I'll pass back to you to decide:

or


Tue, 10 Jan 2017 05:59:06 GMT - Antoine Martin: owner changed

They both turn video region detection back on since the code is the same: the dbus code (ResetVideoRegion in xpra/server/dbus/dbus_server.py) calls the control interface code method (control_command_reset_video_region in xpra/server/server_base.py).


Tue, 10 Jan 2017 17:11:00 GMT - J. Max Mena:

Okay that's weird because I compared both methods and using the DBUS didn't reset video regions, whereas using the control channel did.

For a testing method I connected using Firefox with the OpenGL paint boxes on and looped a video on YouTube? - and using the control channels I set the video region to a small square on the top left of the window away from the video. When I reset it with the control channel, the heuristics found the video region immediately where it should be - and when I used the DBUS channel it didn't reset the video region.

I'll play around with it some more today.


Tue, 10 Jan 2017 19:49:40 GMT - J. Max Mena: owner changed

Okay, I figured it out - the DBUS function you've provided asks for a Boolean rather than an integer for the $WID - following the server logs with -d dbus shows that the only values that get passed to the server are 0 or 1 regardless of what I give as input using D-Feet.

I'll attach a screenshot from D-Feet to show what I mean.

Here's a log snippet of me feeding 4,5,6 into D-Feet:

2017-01-10 11:49:04,636 org.xpra.Server.Get(server-idle-timeout)=0
2017-01-10 11:49:04,636 org.xpra.Server.Get(sharing)=False
2017-01-10 11:49:04,636 org.xpra.Server.Get(idle-timeout)=0
2017-01-10 11:49:04,636 org.xpra.Server.Get(name)=
2017-01-10 11:49:04,636 org.xpra.Server.GetAll(org.xpra.Server)={'server-idle-timeout': 0, 'sharing': False, 'idle-timeout': 0, 'name': ''}
2017-01-10 11:49:04,636 org.xpra.Server.ResetVideoRegion(1)
2017-01-10 11:49:07,412 org.xpra.Server.Get(server-idle-timeout)=0
2017-01-10 11:49:07,412 org.xpra.Server.Get(sharing)=False
2017-01-10 11:49:07,412 org.xpra.Server.Get(idle-timeout)=0
2017-01-10 11:49:07,412 org.xpra.Server.Get(name)=
2017-01-10 11:49:07,412 org.xpra.Server.GetAll(org.xpra.Server)={'server-idle-timeout': 0, 'sharing': False, 'idle-timeout': 0, 'name': ''}
2017-01-10 11:49:07,412 org.xpra.Server.ResetVideoRegion(1)
2017-01-10 11:49:09,484 org.xpra.Server.Get(server-idle-timeout)=0
2017-01-10 11:49:09,484 org.xpra.Server.Get(sharing)=False
2017-01-10 11:49:09,484 org.xpra.Server.Get(idle-timeout)=0
2017-01-10 11:49:09,484 org.xpra.Server.Get(name)=
2017-01-10 11:49:09,484 org.xpra.Server.GetAll(org.xpra.Server)={'server-idle-timeout': 0, 'sharing': False, 'idle-timeout': 0, 'name': ''}
2017-01-10 11:49:09,485 org.xpra.Server.ResetVideoRegion(1)

Tue, 10 Jan 2017 19:49:55 GMT - J. Max Mena: attachment set


Wed, 11 Jan 2017 03:42:24 GMT - Antoine Martin: owner changed

Excellent catch! The windowid should always be a number, fixed in r14755. (and obviously I only tested with a single window, id=1... which fits as a boolean)


Wed, 11 Jan 2017 17:52:26 GMT - J. Max Mena: owner changed

The DBUS function works now!

I'll pass back to you with a request to backport this feature to 1.0.


Thu, 12 Jan 2017 02:41:41 GMT - Antoine Martin: status changed; resolution set

I'll pass back to you with a request to backport this feature to 1.0.


This isn't a bug fix so this isn't really suitable for 1.0, I have added this to the 1.1 queue: wiki/Versions/PendingFixes


Wed, 19 Dec 2018 18:45:51 GMT - Antoine Martin:

See also #1060 for the original SetVideoRegionDetection and SetVideoRegionEnabled dbus api calls, and #1295 to exclude part of the window from the video region


Sat, 23 Jan 2021 05:23:15 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1401