Compare commits

..

1 Commits

Author SHA1 Message Date
Philip Chimento
a1e41b6519 WIP - Remove ShellJS gir
You can define a new importer object by importing a subdirectory in GJS.
This is undocumented, but it is likely to at least hold until the whole
thing moves to ES6 modules.
2016-10-04 22:27:18 -07:00
15 changed files with 434 additions and 2450 deletions

15
NEWS
View File

@@ -1,18 +1,3 @@
3.22.1
======
* Fix hidden network indicator on startup [Florian; #772249]
* Fix order of windows with modal dialogs in window switcher [Florian; #747153]
* Fix feedback loop between StClipboard and X11 bridge [Carlos; #760745]
* Reliably match windows from Flatpak apps [Florian; #772615]
* Misc. bug fixes [Philip; #742249]
Contributors:
Philip Chimento, Carlos Garnacho, Florian Müllner
Translations:
Inaki Larranaga Murgoitio [eu], Khaled Hosny [ar], BM [uz@cyrillic],
Milo Casagrande [it], Cheng-Chia Tseng [zh_TW], gogo [hr]
3.22.0
======
* Misc. bug fixes [Florian, Rui; #771391, #771536] #771656]

View File

@@ -1,5 +1,5 @@
AC_PREREQ(2.63)
AC_INIT([gnome-shell],[3.22.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
AC_INIT([gnome-shell],[3.22.0],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
AX_IS_RELEASE([git-directory])
AC_CONFIG_HEADERS([config.h])
@@ -78,7 +78,7 @@ AC_MSG_RESULT($enable_systemd)
CLUTTER_MIN_VERSION=1.21.5
GOBJECT_INTROSPECTION_MIN_VERSION=1.49.1
GJS_MIN_VERSION=1.39.0
MUTTER_MIN_VERSION=3.22.1
MUTTER_MIN_VERSION=3.22.0
GTK_MIN_VERSION=3.15.0
GIO_MIN_VERSION=2.45.3
LIBECAL_MIN_VERSION=3.5.3

View File

@@ -6,9 +6,7 @@
const Lang = imports.lang;
const Signals = imports.signals;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const ShellJS = imports.gi.ShellJS;
const Config = imports.misc.config;
const FileUtils = imports.misc.fileUtils;
@@ -140,12 +138,11 @@ function createExtensionObject(uuid, dir, type) {
return extension;
}
var _extension = null;
function installImporter(extension) {
_extension = extension;
ShellJS.add_extension_importer('imports.misc.extensionUtils._extension', 'imports', extension.path);
_extension = null;
let oldSearchPath = imports.searchPath.slice(); // make a copy
imports.searchPath = [extension.path];
extension.imports = imports['.']; // "subdir" creates a new importer object
imports.searchPath = oldSearchPath;
}
const ExtensionFinder = new Lang.Class({

View File

@@ -46,19 +46,6 @@ function _createWindowClone(window, size) {
y_expand: true });
};
function getWindows(workspace) {
// We ignore skip-taskbar windows in switchers, but if they are attached
// to their parent, their position in the MRU list may be more appropriate
// than the parent; so start with the complete list ...
let windows = global.display.get_tab_list(Meta.TabList.NORMAL_ALL,
workspace);
// ... map windows to their parent where appropriate ...
return windows.map(w => {
return w.is_attached_dialog() ? w.get_transient_for() : w;
// ... and filter out skip-taskbar windows and duplicates
}).filter((w, i, a) => !w.skip_taskbar && a.indexOf(w) == i);
}
const AppSwitcherPopup = new Lang.Class({
Name: 'AppSwitcherPopup',
Extends: SwitcherPopup.SwitcherPopup,
@@ -530,7 +517,7 @@ const WindowSwitcherPopup = new Lang.Class({
_getWindowList: function() {
let workspace = this._settings.get_boolean('current-workspace-only') ? global.screen.get_active_workspace() : null;
return getWindows(workspace);
return global.display.get_tab_list(Meta.TabList.NORMAL, workspace);
},
_keyPressHandler: function(keysym, action) {
@@ -568,7 +555,7 @@ const WindowCyclerPopup = new Lang.Class({
_getWindows: function() {
let workspace = this._settings.get_boolean('current-workspace-only') ? global.screen.get_active_workspace() : null;
return getWindows(workspace);
return global.display.get_tab_list(Meta.TabList.NORMAL, workspace);
},
_keyPressHandler: function(keysym, action) {

View File

@@ -29,7 +29,6 @@ gl
gu
he
hi
hr
hu
ia
id

1771
po/hr.po

File diff suppressed because it is too large Load Diff

View File

@@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: gnome-shell\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-10-03 09:39+0000\n"
"PO-Revision-Date: 2016-10-06 13:48+0200\n"
"POT-Creation-Date: 2016-09-07 09:41+0000\n"
"PO-Revision-Date: 2016-10-03 11:38+0200\n"
"Last-Translator: Milo Casagrande <milo@milo.name>\n"
"Language-Team: Italiano <tp@lists.linux.it>\n"
"Language: it\n"
@@ -374,7 +374,7 @@ msgstr "Non elencato?"
#. Translators: this message is shown below the username entry field
#. to clue the user in on how to login to the local network realm
#: js/gdm/loginDialog.js:859
#: js/gdm/loginDialog.js:854
#, javascript-format
msgid "(e.g., user or %s)"
msgstr "(p.e. utente o %s)"
@@ -382,12 +382,12 @@ msgstr "(p.e. utente o %s)"
#. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one)
#: js/gdm/loginDialog.js:864 js/ui/components/networkAgent.js:271
#: js/gdm/loginDialog.js:859 js/ui/components/networkAgent.js:271
#: js/ui/components/networkAgent.js:289
msgid "Username: "
msgstr "Nome utente: "
#: js/gdm/loginDialog.js:1201
#: js/gdm/loginDialog.js:1196
msgid "Login Window"
msgstr "Finestra di accesso"
@@ -778,7 +778,7 @@ msgstr "Password rete mobile"
msgid "A password is required to connect to “%s”."
msgstr "È richiesta una password per connettersi a «%s»."
#: js/ui/components/networkAgent.js:647 js/ui/status/network.js:1660
#: js/ui/components/networkAgent.js:647 js/ui/status/network.js:1658
msgid "Network Manager"
msgstr "Gestore reti"
@@ -804,7 +804,7 @@ msgstr "Errore nell'autenticazione. Provare di nuovo."
#. Translators: this is the other person changing their old IM name to their new
#. IM name.
#: js/ui/components/telepathyClient.js:765
#: js/ui/components/telepathyClient.js:760
#, javascript-format
msgid "%s is now known as %s"
msgstr "%s ha cambiato nome in %s"
@@ -1085,10 +1085,9 @@ msgstr "Artista sconosciuto"
msgid "Unknown title"
msgstr "Titolo sconosciuto"
# (ndt) non molto chiaro il suo utilizzo, arriva dal un file che implementa la specifica MPRIS.
#: js/ui/mpris.js:217
msgid "Media"
msgstr "Controlli"
msgstr "Supporto"
#: js/ui/overview.js:84
msgid "Undo"
@@ -1525,11 +1524,11 @@ msgstr "VPN"
msgid "VPN Off"
msgstr "VPN spento"
#: js/ui/status/network.js:1699
#: js/ui/status/network.js:1697
msgid "Connection failed"
msgstr "Connessione non riuscita"
#: js/ui/status/network.js:1700
#: js/ui/status/network.js:1698
msgid "Activation of network connection failed"
msgstr "Attivazione della connessione di rete non riuscita"
@@ -1787,3 +1786,12 @@ msgstr "La password non può essere vuota"
#: src/shell-polkit-authentication-agent.c:353
msgid "Authentication dialog was dismissed by the user"
msgstr "Il dialogo di autenticazione è stato annullato dall'utente"
#~ msgid "Show the week date in the calendar"
#~ msgstr "Mostra il numero della settimana nel calendario"
#~ msgid "If true, display the ISO week date in the calendar."
#~ msgstr "Se VERO, visualizza il giorno della settimana ISO nel calendario."
#~ msgid "Use as Internet connection"
#~ msgstr "Usa come connessione a Internet"

File diff suppressed because it is too large Load Diff

View File

@@ -78,7 +78,7 @@ gnome_shell_cflags = \
-DGNOME_SHELL_PKGLIBDIR=\"$(pkglibdir)\"
privlibdir = $(pkglibdir)
privlib_LTLIBRARIES = libgnome-shell-js.la libgnome-shell-menu.la libgnome-shell.la
privlib_LTLIBRARIES = libgnome-shell-menu.la libgnome-shell.la
noinst_LTLIBRARIES += libgnome-shell-base.la
shell_built_sources = \
@@ -200,7 +200,7 @@ gnome_shell_CPPFLAGS = \
# Here, and after, we repeat mutter and bluetooth libraries just for the rpath
# The dependency is already pulled in by libtool
gnome_shell_LDADD = libgnome-shell.la libgnome-shell-js.la $(GNOME_SHELL_LIBS) $(MUTTER_LIBS)
gnome_shell_LDADD = libgnome-shell.la $(GNOME_SHELL_LIBS) $(MUTTER_LIBS)
gnome_shell_LDFLAGS = -rpath $(MUTTER_TYPELIB_DIR)
gnome_shell_DEPENDENCIES = libgnome-shell.la
@@ -212,7 +212,7 @@ nodist_gnome_shell_extension_prefs_SOURCES = \
$(top_builddir)/js/js-resources.h \
$(NULL)
gnome_shell_extension_prefs_CPPFLAGS = $(gnome_shell_cflags)
gnome_shell_extension_prefs_LDADD = libgnome-shell-js.la $(GNOME_SHELL_LIBS)
gnome_shell_extension_prefs_LDADD = $(GNOME_SHELL_LIBS)
gnome_shell_extension_prefs_LDFLAGS = -rpath $(MUTTER_TYPELIB_DIR)
if HAVE_NETWORKMANAGER
@@ -226,30 +226,13 @@ nodist_gnome_shell_portal_helper_SOURCES = \
$(top_builddir)/js/js-resources.h \
$(NULL)
gnome_shell_portal_helper_CPPFLAGS = $(gnome_shell_cflags)
gnome_shell_portal_helper_LDADD = libgnome-shell-js.la $(GNOME_SHELL_LIBS)
gnome_shell_portal_helper_LDADD = $(GNOME_SHELL_LIBS)
gnome_shell_portal_helper_LDFLAGS = -rpath $(MUTTER_TYPELIB_DIR)
endif
########################################
libgnome_shell_js_la_SOURCES = \
shell-js.h \
shell-js.cpp \
$(NULL)
libgnome_shell_js_la_LIBADD = \
$(GNOME_SHELL_JS_LIBS) \
$(NULL)
libgnome_shell_js_la_LDFLAGS = \
-avoid-version
libgnome_shell_js_la_CPPFLAGS = \
$(GNOME_SHELL_JS_CFLAGS)
########################################
shell_recorder_sources = \
shell-recorder.c \
shell-recorder.h
@@ -366,13 +349,6 @@ Shell_0_1_gir_SCANNERFLAGS = \
INTROSPECTION_GIRS += Shell-0.1.gir
CLEANFILES += Shell-0.1.gir
ShellJS-0.1.gir: libgnome-shell-js.la
ShellJS_0_1_gir_CFLAGS = $(libgnome_shell_la_CPPFLAGS) -I $(srcdir)
ShellJS_0_1_gir_LIBS = libgnome-shell-js.la
ShellJS_0_1_gir_FILES = $(libgnome_shell_js_la_SOURCES)
INTROSPECTION_GIRS += ShellJS-0.1.gir
CLEANFILES += ShellJS-0.1.gir
St-1.0.gir: libst-1.0.la
St_1_0_gir_INCLUDES = Clutter-1.0 Gtk-3.0
St_1_0_gir_CFLAGS = $(st_cflags) -DST_COMPILATION

View File

@@ -6,8 +6,6 @@
#include <gjs/gjs.h>
#include <glib/gi18n.h>
#include "shell-js.h"
int
main (int argc, char *argv[])
{
@@ -51,18 +49,3 @@ main (int argc, char *argv[])
return 0;
}
/* HACK:
Add a dummy function that calls into libgnome-shell-js.so to ensure it's
linked to /usr/bin/gnome-shell-extension-prefs even when linking with
--as-needed. This function is never actually called.
https://bugzilla.gnome.org/show_bug.cgi?id=670477
*/
void _shell_link_to_shell_js (void);
void
_shell_link_to_shell_js (void)
{
shell_js_add_extension_importer (NULL, NULL, NULL, NULL);
}

View File

@@ -25,7 +25,6 @@
#include "shell-global.h"
#include "shell-global-private.h"
#include "shell-js.h"
#include "shell-perf-log.h"
#include "st.h"
@@ -480,17 +479,3 @@ main (int argc, char **argv)
return ecode;
}
/* HACK:
Add a dummy function that calls into libgnome-shell-js.so to ensure it's
linked to /usr/bin/gnome-shell even when linking with --as-needed.
This function is never actually called.
https://bugzilla.gnome.org/show_bug.cgi?id=670477
*/
void _shell_link_to_shell_js (void);
void
_shell_link_to_shell_js (void)
{
shell_js_add_extension_importer (NULL, NULL, NULL, NULL);
}

View File

@@ -1,78 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#include "config.h"
#include "shell-js.h"
#include <gio/gio.h>
#include <gjs/gjs.h>
#include <gjs/gjs-module.h>
/**
* shell_js_add_extension_importer:
* @target_object_script: JavaScript code evaluating to a target object
* @target_property: Name of property to use for importer
* @directory: Source directory:
* @error: A #GError
*
* This function sets a property named @target_property on the object
* resulting from the evaluation of @target_object_script code, which
* acts as a GJS importer for directory @directory.
*
* Returns: %TRUE on success
*/
gboolean
shell_js_add_extension_importer (const char *target_object_script,
const char *target_property,
const char *directory,
GError **error)
{
JS::Value target_object;
GList *contexts;
JSContext *context;
char *search_path[2] = { 0, 0 };
gboolean ret = FALSE;
/* Take the first GjsContext from all of them --
* we should only ever have one context, so this
* should be alright. */
contexts = gjs_context_get_all ();
context = (JSContext*) gjs_context_get_native_context ((GjsContext*)contexts->data);
g_list_free_full (contexts, g_object_unref);
JS_BeginRequest (context);
/* This is a bit of a hack; ideally we'd be able to pass our target
* object directly into this function, but introspection doesn't
* support that at the moment. Instead evaluate a string to get it. */
if (!JS_EvaluateScript(context,
gjs_get_global_object (context),
target_object_script,
strlen (target_object_script),
"<target_object_script>",
0,
&target_object))
{
gjs_log_exception(context);
g_set_error(error,
G_IO_ERROR,
G_IO_ERROR_FAILED,
"Unable to import %s", target_object_script);
goto out;
}
if (!target_object.isObject ())
{
g_error ("shell_js_add_extension_importer: invalid target object");
goto out;
}
search_path[0] = (char*)directory;
gjs_define_importer (context, &target_object.toObject (), target_property,
(const char **)search_path, FALSE);
ret = TRUE;
out:
JS_EndRequest (context);
return ret;
}

View File

@@ -1,16 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef __SHELL_JS_H__
#define __SHELL_JS_H__
#include <glib.h>
G_BEGIN_DECLS
gboolean shell_js_add_extension_importer (const char *target_object_script,
const char *target_property,
const char *directory,
GError **error);
G_END_DECLS
#endif /* __SHELL_JS_H__ */

View File

@@ -202,39 +202,9 @@ get_app_from_window_wmclass (MetaWindow *window)
return NULL;
}
/*
* get_app_from_id:
* @window: a #MetaWindow
*
* Looks only at the given window, and attempts to determine
* an application based on %id. If one can't be determined,
* return %NULL.
*
* Return value: (transfer full): A newly-referenced #ShellApp, or %NULL
*/
static ShellApp *
get_app_from_id (MetaWindow *window,
const char *id)
{
ShellApp *app;
ShellAppSystem *appsys;
char *desktop_file;
g_return_val_if_fail (id != NULL, NULL);
appsys = shell_app_system_get_default ();
desktop_file = g_strconcat (id, ".desktop", NULL);
app = shell_app_system_lookup_app (appsys, desktop_file);
if (app)
g_object_ref (app);
g_free (desktop_file);
return app;
}
/*
* get_app_from_gapplication_id:
* @monitor: a #ShellWindowTracker
* @window: a #MetaWindow
*
* Looks only at the given window, and attempts to determine
@@ -246,35 +216,24 @@ get_app_from_id (MetaWindow *window,
static ShellApp *
get_app_from_gapplication_id (MetaWindow *window)
{
ShellApp *app;
ShellAppSystem *appsys;
const char *id;
char *desktop_file;
appsys = shell_app_system_get_default ();
id = meta_window_get_gtk_application_id (window);
if (!id)
return NULL;
return get_app_from_id (window, id);
}
desktop_file = g_strconcat (id, ".desktop", NULL);
app = shell_app_system_lookup_app (appsys, desktop_file);
if (app)
g_object_ref (app);
/*
* get_app_from_flatpak_id:
* @window: a #MetaWindow
*
* Looks only at the given window, and attempts to determine
* an application based on its Flatpak ID. If one can't be determined,
* return %NULL.
*
* Return value: (transfer full): A newly-referenced #ShellApp, or %NULL
*/
static ShellApp *
get_app_from_flatpak_id (MetaWindow *window)
{
const char *id;
id = meta_window_get_flatpak_id (window);
if (!id)
return NULL;
return get_app_from_id (window, id);
g_free (desktop_file);
return app;
}
/*
@@ -395,13 +354,6 @@ get_app_for_window (ShellWindowTracker *tracker,
if (meta_window_is_remote (window))
return _shell_app_new_for_window (window);
/* Check if the window was opened from within a Flatpak sandbox; if this
* is the case, a corresponding .desktop file is guaranteed to match;
*/
result = get_app_from_flatpak_id (window);
if (result != NULL)
return result;
/* Check if the window has a GApplication ID attached; this is
* canonical if it does
*/

View File

@@ -117,7 +117,6 @@ st_clipboard_provider (GdkXEvent *xevent_p,
GdkDisplay *display = gdk_display_get_default ();
if (xev->type != SelectionRequest ||
xev->xany.window != clipboard->priv->clipboard_window ||
!clipboard->priv->clipboard_text)
return GDK_FILTER_CONTINUE;
@@ -234,15 +233,13 @@ st_clipboard_x11_event_filter (GdkXEvent *xevent_p,
{
XEvent *xev = (XEvent *) xevent_p;
EventFilterData *filter_data = user_data;
StClipboardPrivate *priv = filter_data->clipboard->priv;
Atom actual_type;
int actual_format, result;
unsigned long nitems, bytes_after;
unsigned char *data = NULL;
GdkDisplay *display = gdk_display_get_default ();
if(xev->type != SelectionNotify ||
xev->xany.window != priv->clipboard_window)
if(xev->type != SelectionNotify)
return GDK_FILTER_CONTINUE;
if (xev->xselection.property == None)