After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654518 - chrome: Don't set struts for hidden actors
chrome: Don't set struts for hidden actors
Status: RESOLVED NOTABUG
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-07-13 00:53 UTC by Florian Müllner
Modified: 2011-07-14 00:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
chrome: Don't set struts for hidden actors (1.50 KB, patch)
2011-07-13 00:53 UTC, Florian Müllner
none Details | Review

Description Florian Müllner 2011-07-13 00:53:00 UTC
In response to https://mail.gnome.org/archives/gnome-shell-list/2011-July/msg00105.html - is there a good reason to allow hidden actors to affect struts?
Comment 1 Florian Müllner 2011-07-13 00:53:04 UTC
Created attachment 191856 [details] [review]
chrome: Don't set struts for hidden actors

Hidden actors are already excluded when setting the input region,
I don't see a reason to not do the same for struts.
Comment 2 Dan Winship 2011-07-13 01:47:56 UTC
If they actually wanted the struts to come and go with the panel, they could do "Main.chrome.removeActor(Main.panel.actor)" rather than "Main.panel.actor.hide()". But they don't actually want that, because then the struts would be added/removed every time you entered/left the overview, which would be no good at all, because it would resize all the maximized windows and force them to relayout themselves. What they want is to just remove the affectsStruts flag from the panel, but there's no API that would let them do that.


In general, the theory is that changing the struts is invasive/distracting (because of maximized windows, and the nautilus desktop), and so it should only happen when you fundamentally change the structure of the desktop. If you have a strut-affecting piece of chrome that regularly gets hidden and shown, you don't want the struts to change every time it does. (And in particular, you don't want the struts to go away when you fullscreen a window, which this patch would do...)
Comment 3 Dan Winship 2011-07-13 01:48:39 UTC
(In reply to comment #2)
> What they want is to just remove the
> affectsStruts flag from the panel, but there's no API that would let them do
> that.

well, ok, actually, they could just remove the panel from the chrome, and then re-add it with different flags.
Comment 4 wrobell 2011-07-13 23:05:30 UTC
Main.chrome.removeActor(Main.panel.actor) causes my gnome shell to segv.

what is the purpose of Main.panel.actor.hide, then?

anyway, the code i have so far

------- metadata.js ---------
{ 
   "shell-version": ["3.0"], 
   "uuid": "notopbar@wrobell@pld-linux.org",
   "name": "notopbar",
   "description": "Hide the top bar in Desktop mode",
   "url": "",
   "original-authors": "Artur Wroblewski",
   "locale": "locale"
}
-----------------------------

------- extension.js --------
const Main = imports.ui.main;

const PANEL_HEIGHT = 25;

function _hidePanel() {
    /*
    Main.panel.actor.hide();
    Main.panel._leftCorner.actor.hide();
    Main.panel._rightCorner.actor.hide();
    */
    /*
    Main.chrome.removeActor(Main.panel.actor);
    */

    Main.panel.actor.height = 1;
    Main.panel._leftCorner.actor.y = 0;
    Main.panel._rightCorner.actor.y = 0;
    Main.panel._boxContainer.opacity = 0;
}

function _showPanel() {
    /*
    Main.panel.actor.show();
    Main.panel._leftCorner.actor.show();
    Main.panel._rightCorner.actor.show();
    */

    Main.panel._leftCorner.actor.y = PANEL_HEIGHT - 1;
    Main.panel._rightCorner.actor.y = PANEL_HEIGHT - 1;
    Main.panel._boxContainer.opacity = 255;
    Main.panel.actor.height = PANEL_HEIGHT;
}

function main() {
    _hidePanel()
    Main.overview.connect('showing', _showPanel);
    Main.overview.connect('hiding', _hidePanel);

}
-----------------------------

the uncommented code above is pure hackery of course
(it just causes panel to have no height, opacity trick
is needed to not show panel's content).

using the *.actor.hide() functions make panel's contents
invisible indeed, but that leaves empty space on the top
of the screen (the empty space is exactly the height of
topbar).

what's the purpose of the struts to be left when
actors are not visible anyway?

does Main.chrome.removeActor(Main.panel.actor) work for anyone?
Comment 5 Florian Müllner 2011-07-14 00:45:09 UTC
(In reply to comment #4)
> Main.chrome.removeActor(Main.panel.actor) causes my gnome shell to segv.
> 
> what is the purpose of Main.panel.actor.hide, then?

Sorry, but a bug report is not the appropriate place for that kind of questions.

Anyway:
Main.panel.actor is an object of type ClutterActor (like pretty much anything in gnome-shell), which provides the hide() method.

Your code crashes the shell, because you are only half-following Dan's suggestion - note the "re-add it with different flags", e.g.

Main.chrome.removeActor(Main.panel.actor);
Main.chrome.addActor(Main.panel.actor, { affectsStruts: false });

If you have any further questions, you should ask them on the mailing list or IRC.