[API][DecoratedWindow] Add option to avoid destroying the window when the close button is clicked

Bug #1002039 reported by Victor Martinez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Granite
Fix Released
High
Victor Martinez

Bug Description

In order to achieve better performance and avoid constant redrawing, sometimes it's better to hide a window instead of destroying/re-creating it. This is the case of Noise's album view popover.

The decorated window API needs an option to hide the window, instead of destroying it, when the close button is clicked. I suggest something like:

public bool hide_on_close { get; set; default = false; }

Related branches

Revision history for this message
Victor Martinez (victored) wrote :

Marking as high-priority since Noise needs it.

Changed in granite:
importance: Undecided → High
milestone: none → 0.1.1
status: New → Confirmed
tags: added: api bitesize decorated-window
Changed in granite:
assignee: nobody → Victor Eduardo (victored)
status: Confirmed → In Progress
Cody Garver (codygarver)
Changed in granite:
status: In Progress → Fix Committed
Revision history for this message
Cris Dywan (kalikiana) wrote :

How about using delete-event instead to stay in line with Gtk.Window API?

Revision history for this message
Victor Martinez (victored) wrote :

Not a bad idea. We probably want to change that before releasing the next version.

Revision history for this message
Victor Martinez (victored) wrote :

Okay, the new implementation is available on: lp:~victored/granite/decorated-window-api-fixes
It uses the delete-event instead of a custom property. Thanks for the suggestion Christian!

summary: - [API][DecoratedWindow] Add hide-on-close option
+ [API][DecoratedWindow] Add option to avoid destroying the window when
+ the close button is clicked
Changed in granite:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.