Re: gdk.window set_decorations works in python not javascript bindings (v3.0)



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;
Gtk.init(null);

The Gtk.init() and Gdk.init() functions are not currently totally
functional when called through gobject-introspection but this should
work for your case.

Rui


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]