Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1333 from mtwebster/pixelated

Fix for pixelated alt-tab entries
  • Loading branch information...
commit 61f3bc16fd1c59f136f811f7eaee2a6dd685fcb2 2 parents a8bd712 + c494bd1
@clefebvre clefebvre authored
View
10 files/usr/share/applications/cinnamon-add-panel-launcher.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Panel Launcher Editor
+Comment=Add or edit panel launcher applet entries
+Exec=/usr/share/cinnamon/applets/panel-launchers@cinnamon.org/cinnamon-add-panel-launcher.py
+Icon=gnome-panel-launcher
+Terminal=false
+NoDisplay=true
+Type=Application
+Categories=GNOME;GTK;Settings;DesktopSettings;
+StartupNotify=false
View
10 files/usr/share/applications/cinnamon-menu-editor.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Cinnamon Menu Editor
+Comment=Edit the entries of the Cinnamon menu applet
+Exec=cinnamon-menu-editor
+Icon=alacarte
+Terminal=false
+Type=Application
+NoDisplay=true
+Categories=GNOME;GTK;Settings;DesktopSettings;
+StartupNotify=false
View
4 files/usr/share/cinnamon/applets/panel-launchers@cinnamon.org/applet.js
@@ -370,14 +370,14 @@ MyApplet.prototype = {
showAddLauncherDialog: function(timestamp, launcher){
if (launcher) {
- let cl = APPLET_DIR.get_child('add-panel-launcher.py').get_path() + ' ';
+ let cl = APPLET_DIR.get_child('cinnamon-add-panel-launcher.py').get_path() + ' ';
cl += '"' + launcher.getId() + '" ';
cl += '"' + launcher.getAppname() + '" ';
cl += '"' + launcher.getCommand() + '" ';
cl += '"' + launcher.getIcon() + '"';
Util.spawnCommandLine(cl);
} else {
- Util.spawnCommandLine(APPLET_DIR.get_child('add-panel-launcher.py').get_path());
+ Util.spawnCommandLine(APPLET_DIR.get_child('cinnamon-add-panel-launcher.py').get_path());
}
},
View
2  ...l-launchers@cinnamon.org/add-panel-launcher.glade → ...rs@cinnamon.org/cinnamon-add-panel-launcher.glade
@@ -7,7 +7,7 @@
<property name="title" translatable="yes">Add panel launcher...</property>
<property name="resizable">False</property>
<property name="window_position">center</property>
- <property name="icon_name">list-add</property>
+ <property name="icon_name">gnome-panel-launcher</property>
<property name="type_hint">dialog</property>
<signal name="close" handler="onDeleteWindow" swapped="no"/>
<child internal-child="vbox">
View
2  ...anel-launchers@cinnamon.org/add-panel-launcher.py → ...chers@cinnamon.org/cinnamon-add-panel-launcher.py
@@ -119,7 +119,7 @@ def onIconChanged(self, *args):
custom_launchers_path = userhome + "/.cinnamon/panel-launchers"
applet_dir = os.path.dirname(inspect.getfile(inspect.currentframe()))
-builder.add_from_file(applet_dir + "/add-panel-launcher.glade")
+builder.add_from_file(applet_dir + "/cinnamon-add-panel-launcher.glade")
window = builder.get_object("add-panel-launcher-dialog")
builder.connect_signals(Handler())
View
36 src/cinnamon-app-system.c
@@ -109,7 +109,7 @@ cinnamon_app_system_init (CinnamonAppSystem *self)
priv->apps_tree = gmenu_tree_new ("cinnamon-applications.menu", GMENU_TREE_FLAGS_INCLUDE_NODISPLAY);
g_signal_connect (priv->apps_tree, "changed", G_CALLBACK (on_apps_tree_changed_cb), self);
- priv->settings_tree = gmenu_tree_new ("cinnamon-settings.menu", 0);
+ priv->settings_tree = gmenu_tree_new ("cinnamon-settings.menu", GMENU_TREE_FLAGS_INCLUDE_NODISPLAY);
g_signal_connect (priv->settings_tree, "changed", G_CALLBACK (on_settings_tree_changed_cb), self);
on_apps_tree_changed_cb (priv->apps_tree, self);
@@ -490,6 +490,20 @@ cinnamon_app_system_get_default ()
return instance;
}
+gboolean
+case_insensitive_search (const char *key,
+ const char *value,
+ gpointer user_data)
+{
+ char *given_id = (char *) user_data;
+
+ if (g_ascii_strcasecmp(key, given_id) == 0) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
/**
* cinnamon_app_system_lookup_app:
*
@@ -501,7 +515,13 @@ CinnamonApp *
cinnamon_app_system_lookup_app (CinnamonAppSystem *self,
const char *id)
{
- return g_hash_table_lookup (self->priv->id_to_app, id);
+ CinnamonApp *result;
+
+ result = g_hash_table_lookup (self->priv->id_to_app, id);
+ if (result == NULL) {
+ result = g_hash_table_find (self->priv->id_to_app, (GHRFunc) case_insensitive_search, id);
+ }
+ return result;
}
/**
@@ -515,7 +535,13 @@ CinnamonApp *
cinnamon_app_system_lookup_settings_app (CinnamonAppSystem *self,
const char *id)
{
- return g_hash_table_lookup (self->priv->setting_id_to_app, id);
+ CinnamonApp *result;
+
+ result = g_hash_table_lookup (self->priv->setting_id_to_app, id);
+ if (result == NULL) {
+ result = g_hash_table_find (self->priv->setting_id_to_app, (GHRFunc) case_insensitive_search, id);
+ }
+ return result;
}
/**
@@ -614,6 +640,10 @@ cinnamon_app_system_lookup_heuristic_basename (CinnamonAppSystem *system,
if (result != NULL)
return result;
+ result = cinnamon_app_system_lookup_settings_app (system, name);
+ if (result != NULL)
+ return result;
+
for (prefix = system->priv->known_vendor_prefixes; prefix; prefix = g_slist_next (prefix))
{
char *tmpid = g_strconcat ((char*)prefix->data, name, NULL);
View
16 src/cinnamon-window-tracker.c
@@ -143,7 +143,6 @@ get_appid_from_window (MetaWindow *window)
wmclass = meta_window_get_wm_class (window);
if (!wmclass)
return NULL;
-
appid_guess = g_ascii_strdown (wmclass, -1);
/* This handles "Fedora Eclipse", probably others.
@@ -204,6 +203,19 @@ cinnamon_window_tracker_is_window_interesting (MetaWindow *window)
return TRUE;
}
+gchar *
+strip_extension (gchar *wm_class)
+{
+ char *result;
+ if (g_str_has_suffix (wm_class, ".py") ||
+ g_str_has_suffix (wm_class, ".sh")) {
+ result = g_strndup (wm_class, strlen (wm_class) - 3);
+ } else {
+ result = g_strdup (wm_class);
+ }
+ return result;
+}
+
/**
* get_app_from_window_wmclass:
*
@@ -222,7 +234,7 @@ get_app_from_window_wmclass (MetaWindow *window)
char *with_desktop;
appsys = cinnamon_app_system_get_default ();
- wmclass = get_appid_from_window (window);
+ wmclass = strip_extension(get_appid_from_window (window));
if (!wmclass)
return NULL;
Please sign in to comment.
Something went wrong with that request. Please try again.