xpra icon
Bug tracker and wiki

#1401 closed enhancement (fixed)

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

Reported by: alas Owned by: Antoine Martin
Priority: major Milestone:
Component: server Version: trunk
Keywords: Cc:

Description

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.

Attachments (1)

1401dfeet.png (32.9 KB) - added by J. Max Mena 11 months ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 months ago by Antoine Martin

Owner: changed from Antoine Martin to alas
Summary: A function to lear video region detection, rather than setting to 0 coordinates and hoping for the best, might come in handyA function to clear video region detection, rather than setting to 0 coordinates and hoping for the best, might come in handy

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

  • xpra control :DISPLAY reset-video-region WINDOWID
  • via the dbus interface: ResetVideoRegion(WINDOWID)

This will reset everything except for the exclude regions list.

Last edited 11 months ago by Antoine Martin (previous) (diff)

comment:2 Changed 11 months ago by J. Max Mena

Owner: changed from alas to Antoine Martin

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:

  • Leave it the way it is and make a note of it somewhere

or

  • Change either the DBUS or the Control Channel to give bring them up to parity.

comment:3 Changed 11 months ago by Antoine Martin

Owner: changed from Antoine Martin to alas

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

comment:4 Changed 11 months ago by 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.

comment:5 Changed 11 months ago by J. Max Mena

Owner: changed from alas to Antoine Martin

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)

Changed 11 months ago by J. Max Mena

Attachment: 1401dfeet.png added

comment:6 Changed 11 months ago by Antoine Martin

Owner: changed from Antoine Martin to J. Max Mena

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)

comment:7 Changed 10 months ago by J. Max Mena

Owner: changed from J. Max Mena to Antoine Martin
  • Upped server and client to r14763 trunk

The DBUS function works now!

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

comment:8 Changed 10 months ago by Antoine Martin

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.