Ticket #1102 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Make the unfullscreen go away after a timeout

Reported by: sayamindu Owned by: erikos
Priority: Unspecified by Maintainer Milestone: Unspecified by Release Team
Component: sugar-toolkit Version: Git as of bugdate
Severity: Unspecified Keywords: r+
Cc: eben, garycmartin Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

The unfullscreen button should go away after a timeout, and should reappear on pointer movement.

Ref:  http://lists.sugarlabs.org/archive/sugar-devel/2009-July/017045.html

Attachments

dslo1102.patch Download (3.8 KB) - added by sayamindu 4 years ago.
Patch to implement the behaviour. The unfullscreen button disappears after a 2 second timeout.
dslo1102_2.patch Download (3.8 KB) - added by sayamindu 4 years ago.
Revised patch

Change History

Changed 4 years ago by sayamindu

Patch to implement the behaviour. The unfullscreen button disappears after a 2 second timeout.

  Changed 4 years ago by tomeu

  • keywords r- added
UNFULLSCREEN_BUTTON_VISIBILITY_TIMEOUT = 2

Please prepend with _ if it isn't meant to be used out this module.

        events = self._event_box.get_events() 
	        self._event_box.set_events(events | gtk.gdk.POINTER_MOTION_MASK | \ 
	            gtk.gdk.POINTER_MOTION_HINT_MASK) 

Better use add_events()?

                if self._unfullscreen_button_timeout_id: 

Better use "is not None" (see PEP 8 for rationale).

                gobject.timeout_add_seconds(UNFULLSCREEN_BUTTON_VISIBILITY_TIMEOUT, \

Not setting self._unfullscreen_button_timeout_id anywhere?

    def __motion_notify_cb(self, widget, event): 

I'm a (small) bit concerned about doing so much stuff at every motion event, any idea about how to reduce further the amount of work done at every motion event when in fullscreen?

    def _unfullscreen_button_timeout_cb(self): 

Shouldn't we set self._unfullscreen_button_timeout_id to None here?

And please remember to set the r? flag so it doesn't get lost so easily.

Changed 4 years ago by sayamindu

Revised patch

  Changed 4 years ago by sayamindu

  • keywords r? added; r- removed

The second patch addresses all the issues. As for motion_notify_cb, I'm not sure, but as per my reading of  http://library.gnome.org/devel/gdk/stable/gdk-Events.html#GdkEventMask, I think gtk.gdk.POINTER_MOTION_HINT_MASK would ensure that only motion hints are delivered, and not all motion that occurs.

follow-ups: ↓ 4 ↓ 5   Changed 4 years ago by sascha_silbe

While having it disappear at all is a good start (and sufficient for activities like Read), I don't like it reappearing on every pointer movement. Fullscreen mode is useful is pointer-using activities as well (e.g. Browse - you need the pointer to follow links).

in reply to: ↑ 3   Changed 4 years ago by tomeu

  • cc eben, garycmartin added
  • keywords r+ added; r? removed
  • status changed from new to closed
  • resolution set to fixed

Replying to sascha_silbe:

While having it disappear at all is a good start (and sufficient for activities like Read), I don't like it reappearing on every pointer movement. Fullscreen mode is useful is pointer-using activities as well (e.g. Browse - you need the pointer to follow links).

Any idea about what would be more appropriate for activities like Browse?

I think we can apply the patch as-is for now, please enter another ticket if there's any further work we need to do on this.

in reply to: ↑ 3   Changed 4 years ago by garycmartin

Replying to sascha_silbe:

While having it disappear at all is a good start (and sufficient for activities like Read), I don't like it reappearing on every pointer movement. Fullscreen mode is useful is pointer-using activities as well (e.g. Browse - you need the pointer to follow links).

I think kids would get stuck in fullscreen mode and not know how to get out, actually I know a few adults who would get stuck as well ;-)

Note: See TracTickets for help on using tickets.