Pass the error variable to g_key_file_load_from_data_dirs in
Shell.AppSystem.get_default().load_from_desktop_file again, and
use a try/catch in places.js.
This fixes Shell.TextureCache.get_default().load_thumbnail so
that it can be used to get thumbnails (with an icon matching
the mimetype or, in the worst case, gtk-file, as fallback) for
items which don't have a GtkRecentlyUsed object. This is needed
for the Zeitgeist integration.
- Avoid error '"iconname" may be used uninitialized in this function'
by initializing said variable to NULL.
- Define shell_util_get_file_description as static (like the other
similar functions) to avoid another compiler error.
- Don't save errors from g_key_file_load_from_data_dirs into the
variable "error" (ie. pass NULL to it instead). Without this,
gnome-shell crashes if the key file can't be found (with message
"Error invoking Shell.load_from_desktop_file: Valid key file could
not be found in search dirs").
- Check the result of the load_from_desktop_file() call in places.js,
as it may be null.
Previously, ShellAppSystem only loaded (and cached) the set of
.desktop files from applications.menu and settings.menu, using
the gnome-menus library. The ShellAppInfo structure was
a "hidden typedef" for GMenuTreeEntry.
But we need to support loading an arbitrary .desktop file. Thus,
refactor the ShellAppInfo into a real struct, with a refcount,
and allow it to point to either a GMenuTreeEntry or a GKeyFile.
Also, in the case where we fail to lookup an icon for an
application, ensure we return a 0 opacity texture.
Use ShellGenericContainer to implement a fully dynamic layout
for the application well. It's still fixed to 4 columns by default,
but no longer requires a fixed width to be passed in on start.
With another chunk of work, it could likely try to adjust to
the case where we can only fit fewer than 4 items in the well.
Remove the border highlighting on mouseover, since that caused
reallocations, and the grid layout isn't trivial.
Delete the unused shell_global_get_word_with function.
For both of these, because of optimizations a few patches ago, we
ended up relying on hash table ordering which caused instability
in the application well among other things. Define an ordering
for both.
The favorites is just the order of the GConf keys, and new items
get appended. In the future we should allow insertion at any
point which the grid could use.
For running applications order, define a new "initially_seen_sequence"
transient variable which is just an monotonically incrementing
integer assigned to an application for the first time we saw it
running in this session. When an application is closed, it's reset.
When exiting from --replace mode, we want to start the new
gnome-panel with a reasonable working directory so that if, you say,
open a terminal from it it doesn't start off in the gnome-shell
directory.
(gnome-shell itself is running in $HOME because mutter changes
directory itself at startup.)
Reported by Mathieu Bridon
http://bugzilla.gnome.org/show_bug.cgi?id=591145
Some C library versions have __attribute__((warn_unused_result)) on
fgets(). We really don't care since we are just throwing the data
away, but check the result anyways.
When AM_SILENT_RULES is available, use it to strip down the output
of make so we can see what's important rather than gigantic long
compile lines.
Use 'make V=1' to see everything again.
Fix a couple of places where we had 'cmp' rather than 'cmp' and were
getting standard-error spew about missing files when generating
enum-types.h files.
http://bugzilla.gnome.org/show_bug.cgi?id=591002
src/shell-global.c src/shell-process.c: Remove dead code
src/shell-texture-cache.c src/shell-status-menu.c: Remove
<foo>_new() functions that weren't in the header file and
not used anyways:
src/shell-texture-cache.[ch]: Fix a prototype that used ()
when (void) was intended.
http://bugzilla.gnome.org/show_bug.cgi?id=590998
Move the GStreamer initialization from the Javascript code into
shell_recorder_init(). This avoids a dependency on the GStreamer
introspection information and will make it easier to drop the
gir-repository module dependency.
Said function in genericDisplay.js was returning the index of the
actor based upon its position in the entire list, while everywhere
else indexes relative to the currently displayed page were used.
This made actions in the details pane break (bug #590949), so I
replace it with a new function in shell-overflow-list.c,
shell_overflow_list_get_actor_index, which is page based.
Subclass ClutterGroup (to avoid having to implement all of dispose,
raise, lower, add, etc.), and have it proxy the allocation requests
out into signals. We have to group up the two out parameters
into a struct unfortunately.
Included example code in the C file source for now.
The previous application monitoring code was originally designed
to be based on WM_CLASS, which was then resolved on a server.
We have that resolution code locally now, so instead
of saving WM_CLASS data, save application IDs.
Also, inside the WM we have a much better
infrastructure for tracking windows. In particular, rather
than polling, we can just watch for focus notification on
the display, and window add/remove.
Instead of polling XScreensaver, use DBus to watch org.gnome.Session
which already has an idle time watch.
Now there is no polling at all inside the monitor.
When we fail to load a texture, make sure we keep it 0 opacity to avoid
a white square. Also this is useful to avoid the square while loading
a texture asynchronously.
Corresponding with the design, if an application is in a running
state (has > 0 windows open), draw a glow behind the name.
To make the display look a bit nicer, set the width of each item
to be equal to the longest word among all the items.
Make sure that we calculate the next update time correctly.
Store timeout time instead of the timeout delta, so that it doesn't get outdated.
Create a new callback when the time update happens for the original callback.
Make sure last visited time is updated in the details pane by keeping track
of the description actors created for the detail actors.
Add comments to the new functions.
Avoid depending on gdb for replacing an existing panel, since it
requires debuginfo and gdb installed.
Instead we grab the org.gnome.Panel DBus name, using DBus name
replacement semantics.
Extend ShellTextureCache by adding the concept of a policy, which
we expose to the public API for loading URIs.
This lets us have the shell tell the cache to keep the information
icon texture around forever.
Secondly, fix the caching of recent info; we shouldn't always be
loading the backup pixbuf. Move recent info loading entirely
into ShellTextureCache.
GenericDisplay wasn't quite completely converted to the ShellOverflowList
model. Since the list now holds all actors, the indexing/wrapping
was incorrect.
Add a property which lets us keep track of how many items are displayed,
use this in genericDisplay.
Avoid setting selectedIndex to -2 when going up with no items.
If we're not displaying any results at all, don't attempt keynav (for now).
Make the ClutterText and ClutterTexture from the status menu
button available to JavaScript, and from there improve the
font definition of the user name.
shell-status-menu.[ch]: Add public get_name() and get_icon()
functions that return the user name label and icon
texture, remove the markup from update_name_text().
panel.js: Set the font for the button consistently with that
of the other panel labels.
Move thumbnail creation into ShellTextureCache. It's now asynchronous,
and we cache the result.
Create a DocManager class which keeps around the DocInfo objects between
invocations. This is also where we ensure we remove thumbnails for
recent items not known anymore.
Before, we looked up application data in several ways; the ShellAppSystem
exported just application ids (though it parsed the .desktop files internally),
and we'd create a Gio.DesktopAppInfo object (reparsing the desktop file again),
wrapping that inside a JavaScript AppInfo class, and finally the AppDisplay
would again parse the .desktop file to get the categories.
Also, to look up applications by id previously, we traversed the entire
menu structure each time.
Some qualities such as the NoDisplay flag were not easily exposed in the old
system. And if we wanted to expose them we'd have to change several different
application information wrapper classes.
All in all, it was quite suboptimal.
The theme of this new code is basically "just use libgnome-menus". We do
not call into Gio for app lookups anymore. The new Shell.AppInfo class
is a disguised pointer for the GMenuTreeEntry item.
To fix the caching, we keep a simple hash table of desktop id -> ShellAppInfo.
ShellDrawingArea is a size-independent wrapper for a ClutterCairoTexture.
Useful when drawing non-fixed size areas.
ShellStack is a simple container class which holds items
in a completely overlapping Z stack. The main difference
from ClutterGroup is that items will be constrained to
(and allocated) the size of the stack, not getting their
preferred size always.
Although methods like gconf_client_get/set_bool() and such are usable
from gjs, get_list/set_list is not, since there's only one method for
all list types. So ShellGConf wraps GConfClient and adds separate
typed list methods.
Also, add a detailed "changed" signal that can easily be connected to
from js, since we can't currently use gconf_client_notify_add()
directly.
Searching across NoDisplay desktop items can produce weird
results to the user (including duplicates, and items that
aren't really applications at all.) So, don't include them
normally.
But continue including NoDisplay items when we look up the
desktop file for a window, since we want to catch applications
like Evince and Nautilus which are otherwise NoDisplay.
http://bugzilla.gnome.org/show_bug.cgi?id=587548
This is not a complete patch; it doesn't attempt to handle the homogenous
property or column major.
(Based on patch by Colin Walters <walters@verbum.org>)
http://bugzilla.gnome.org/show_bug.cgi?id=587720
Add a GConf key for favorites, and API for retrieving them.
Also add shell_app_system_lookup_basename, which we use from
the app monitor to look up WM_CLASS ids.
Track all windows; at the time of opening (and shell startup)
we call into ShellAppSystem to take the WM_CLASS property and
try to find an associated .desktop file.
Add mozilla-firefox to the list of our WM_CLASS workarounds.
Add shell_global_get_screen, since it's often used.
Fix up the comments about the horizontal gradient code and use 8x1 texture
instead of 8x8.
Make sure the values we assign to the three-stop horizontal gradient
require the use of the three stop gradient, with the middle value not being
right between the side values.
Display the results pane above the workspaces. The results pane is somewhat
transparent and has a blue gradient background. The dash pane is slightly
transparent and also has a blue gradient background.
The results pane shows up when a More control is clicked. It disappears when
a Less control is clicked, an area outside of the dash area is clicked,
an item starts being dragged, or the overlay mode is exited.
Add shell_global_create_horizontal_gradient() to shell-global.[ch]
Currently we position the user status menu at the upper left of
the user status button. Then, because Mutter is inappropriately
positioning override-redirect windows it get shoved into the
workarea. Once that bug is fixed (bug 582639), we'll have to
position the menu ourselves.
This patch aligns the user status menu at the left end of
and beneath the top panel.
http://bugzilla.gnome.org/show_bug.cgi?id=586156
Currently function shell_get_thumbnail_for_recent_info located in
src/shell-global.c is used to get thumbnails for recently used files.
However, it only works if you have a GtkRecentInfo object for the file,
even though the thumbnail generation code doesn't depend on it. This commit
renames the function to shell_get_thumbnail and makes it generic so that it
just takes two strings: a filename and a mimetype.
When there is no root pixmap, the result will be a CoglMaterial
with a layer with no texture, and that causes a crash.
Work around this by supressing painting the root pixmap actor
when there is no root pixmap.
http://bugzilla.gnome.org/show_bug.cgi?id=585196
- clutter_actor_get_transformed_position()/size() return floats
- clutter_stage_get_actor_at_pos() takes a pick mode
- ClutterTimeline no longer has a concept of frames
- ClutterUnit is now replaced by float
- cogl_texture_new_from_data() signature changed
http://bugzilla.gnome.org/show_bug.cgi?id=585013
With clutter changes, we can now no longer clone an actor unless
it is part of a stage. So, we hide the root pixmap source, and
add it.
This means that the logic to free the source actor when the
last clone disappears no longer applies, since the stage will also
reference it; so we just leave the actor around permanently.
http://bugzilla.gnome.org/show_bug.cgi?id=585012
We need a foreach_with_internals() function that includes the
background_texture/background_rectangle actors, so that states
will properly be updated on map/unmap/etc.
http://bugzilla.gnome.org/show_bug.cgi?id=585007
- ClutterUnit is now replaced with float
- allocate() now takes flags rather than absolute_origin_changed boolean
- cogl_texture_new_from_data() signature changed
http://bugzilla.gnome.org/show_bug.cgi?id=585007
The code here is significantly cleaner if we use the data Metacity
already has cached and validated, rather than talking to X directly.
Also some preparatory work for extending the monitor API by
clarifying the name of the (current) main entry point.
To avoid loading applications from two different systems, use
ShellAppSystem solely. This unifies the initial load and the
reload.
Extend ShellAppSystem to also load settings/preferences, and
ensure they appear in the search.
We need to include the icon size in the data we pass to on_pixbuf_loaded()
so that we can include it in the key we use when caching the icon
Currently we save icons in the cache at size 0 but look them up at size 48
so no caching occurs.
http://bugzilla.gnome.org/show_bug.cgi?id=583503
Recent gjs changes have made it log most types of messages (including
log() calls) only to a configured log file and not to stderr. So,
set GJS_DEBUG_OUTPUT=stderr to make *stderr* the log file and get
our log() calls back.
Add a ShellTextureCache class which loads (and can cache)
pixmap->texture conversions. This fixes a problem with the
async code in ClutterTexture that it was lower priority
than animations, and also ensures we're really only
loading these pixbufs once in the icon case.
We need to reset the popularity GSList* at start, and everytime we load data about a another activity. This also implies fixing the typo about (activity != -1).
Thanks to Dan Winship. http://bugzilla.gnome.org/show_bug.cgi?id=582215
If a file already has a failed thumbnail indicator, don't try to
thumbnail it, and if thumbnailing fails, create a failed thumbnail
indicator. (In particular, so that if thumbnail creation times out, we
don't keep retrying and eventually timing out every time the user
opens the overlay.)
http://bugzilla.gnome.org/show_bug.cgi?id=568081
This solves several issues:
- use built-in default so that app monitoring is enabled when schemas are not installed
- don't start/stop timers without checking their previous state
- unreference the default GConfClient
- use #define for the GConf key path
Just because ShellTrayManagerChild had a 'manager' field, I shouldn't
have assumed it was actually being set; fixes a crash with tray icons
that don't support RGBA visuals.
Unless we're running gnome-shell from the source directory, we shouldn't
use the .la file as the mutter plugin. Instead, we use the dynamic
library.
Closes: bgo#581327
* Rename ShellGtkWindowActor to ShellGtkEmbed, and make it require
a ShellEmbeddedWindow rather than a general GtkWindow.
* Add ShellEmbeddedWindow subclass of GtkWindow that bypasses most
of the GtkWindow complexity for size negotiation, and calls out
to a clutter actor instead; also automatically handle reparenting
the GtkWindow into the stage window.
* Use the reworked ShellGtkEmbed in ShellTrayManager, this simplifies
the code a bit, and more importantly results in the tray icons
having the correct size negotiation, rather than having a fixed
24x24 size.
http://bugzilla.gnome.org/show_bug.cgi?id=580047
This is a fairly simple implementation, not all that different from
plain metacity's. Further improvements could be made to
js/ui/altTab.js in the future.
http://bugzilla.gnome.org/show_bug.cgi?id=580917
Calling gdk_window_get_events() then gdk_window_set_events() will
remove "exotic" X event masks that GDK doesn't know about like
SubstructureRedirectMask. A window manager that doesn't select
for SubstructureRedirectMask on the root window is no longer
really a window manager, so various Bad Things were happening.
We can just piggy-back on Mutter selecting for PropertyNotify
events on the root window, so removing the code works fine.
http://bugzilla.gnome.org/show_bug.cgi?id=580572 (reported by Mike Bursell)
Now code can call Main.addShellActor(actor) to declare that that actor
is part of the shell, and so it should (a) be protected by wm struts, and
(b) be part of the stage input area, and then that code automatically
deals with updating if the actor changes size or visibility.