Re: getting rid of topbar
- From: "Jasper St. Pierre" <jstpierre mecheye net>
- To: Artur Wroblewski <wrobell pld-linux org>
- Cc: gnome-shell-list gnome org
- Subject: Re: getting rid of topbar
- Date: Thu, 14 Jul 2011 04:10:38 -0400
On Thu, Jul 14, 2011 at 4:00 AM, Artur Wroblewski
<wrobell pld-linux org> wrote:
On Wed, Jul 13, 2011 at 11:40 PM, Artur Wroblewski
<
wrobell pld-linux org> wrote:
> Any tips how to simplify the code above?
Thanks to
I have the following code, which works
-------
const Main = imports.ui.main;
function _hidePanel() {
Main.chrome.removeActor(Main.panel.actor);
Main.chrome.addActor(Main.panel.actor, { affectsStruts: false });
Main.panel.actor.hide();
Main.panel._leftCorner.actor.hide();
Main.panel._rightCorner.actor.hide();
}
function _showPanel() {
Main.chrome.removeActor(Main.panel.actor);
Main.chrome.addActor(Main.panel.actor, { affectsStruts: true });
Main.panel.actor.show();
}
function main() {
_hidePanel()
Main.overview.connect('showing', _showPanel);
Main.overview.connect('hiding', _hidePanel);
}
-------
I would really appreciate explanation why the code has to be so
complex? IMHO, simple Main.panle.actor.hide should be intuitive
enough.
We use a feature of the WM spec called "struts"[0] that tells the WM: "at all costs, don't put the window here." We make it look like the top panel is "blocking" the windows, but that's just some trickery.
Try going to the first workspace and typing into the Looking Glass:
global.screen.get_workspace_by_index(0).set_builtin_struts([]);
Get your struts back by going in and out of the overview (hit the Super key twice).
Hiding the actor doesn't unset the strut. That's the bug that Florian filed. It was shot down for a few reasons, one being that it's a bit costly for the WM, and we hide/show the top panel in certain cases but don't want to re-set the strut.
What's its other purpose? Why it does not hide whole
panel (API (?), i.e. "panel._leftCorner" suggests that corners are part
of the topbar).
The top panel and the corners are an illusion -- they're actually three
separate actors. Main.panel.actor refers to the "main" one with all the content.
Is it intrusive (as explained in bugzilla, see link above)? Of course, it is
as it hides the panel...
Any answers and pointers to documentation or code highly appreciated.
--
Jasper
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]