- From: Rui Tiago Cação Matos <tiagomatos gmail com>
- To: Amy C <mathematical coffee gmail com>
- Cc: gnome-shell-list gnome org, gtk-list gnome org
- Date: Sun, 6 May 2012 23:37:27 +0200
On 6 May 2012 15:17, Amy C <mathematical coffee gmail com> wrote:
> When I execute this code from the GNOME interactive gjs interpreter
> (looking glass), when I execute `curwin.set_decorations(0)` the window
> in question closes itself. For example, if the current window is a
> terminal and it has a process running in it I'll get the "Running
> process in terminal; are you sure you want to quit?" dialog, from
> which I can select Cancel (window will be maximised/undecorated as I
> wish). If there are no processes running in the terminal, it will
> simply quit!
You can't use GDK like that form inside the window manager.
> However, if execute this using the `gjs` binary (whether running
> GNOME-shell or unity+metacity) I get "ERROR: Gdk.Screen.get_default()
> is null" -- some environment variable not set up properly?? $DISPLAY
> is :0 as normal.
Try the following before your code:
const Gtk = imports.gi.Gtk;
The Gtk.init() and Gdk.init() functions are not currently totally
functional when called through gobject-introspection but this should
work for your case.
] [Thread Prev