Commit Graph

211 Commits

Author SHA1 Message Date
Adel Gadllah
ceedc7e32c Implement cross overview drag & drop
The gnome-panel allows the user to hover over a tasklist entry
while draging to activate a minimized or obscured window and drop onto it.

Implement a similar behaviour by allowing draging to the activities button or
the hotcorner (and thus opening the overview), which allows the user to
activate any window (even on different workspaces) as a drop target.

https://bugzilla.gnome.org/show_bug.cgi?id=601731
2011-01-05 23:19:56 +01:00
Owen W. Taylor
c546ad9720 Fix for gdk/x11 changes
Handle the move of gdk_window_lookup() and gdk_window_foreign_new()
into the gdk_x11_ namespace.
2010-12-22 16:26:08 -05:00
Owen W. Taylor
8be2800486 ShellGlobal: Remove root_pixmap left-over
Still had a few references to the root_pixmap actor that was removed
when we switched to using the root actor support in Mutter.
2010-12-09 19:14:26 -05:00
Maxim Ermilov
65f0b483f8 messageTray: make links in message banners clickable
https://bugzilla.gnome.org/show_bug.cgi?id=610219
2010-11-24 02:38:08 +03:00
Owen W. Taylor
e5a802bf99 Use the new "background actor" functionality in Mutter
The code to draw the root background has now been moved into Mutter,
with added smarts to not draw obscured portions. Remove the old
version of the code and clone the Mutter background actor to draw
the background in the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=634836
2010-11-18 14:03:37 -05:00
Dan Winship
5a83ef8325 St: add StFocusManager, to handle keyboard navigation
StFocusManager allows setting up "focus groups" in which it will
automatically handle navigation between can_focus widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=621671
2010-10-29 08:38:05 -04:00
Owen W. Taylor
2fa6f7ba7e Adapt to removal of Mutter namespace
MutterWindow and MutterPlugin have been renamed to MetaWindowActor
and MetaPlugin, mutter_plugin_list_windows() to
meta_plugin_list_window_actors(). Adapt to those changes.

https://bugzilla.gnome.org/show_bug.cgi?id=632500
2010-10-23 14:02:45 -04:00
Colin Walters
85d3336245 Use gjs-internals.pc
Gjs changed to separate the "basic" API from "embedder" API.  Unfortunately
due to our use of the importer API and a few other bits, we need to use
the "module" one.  In the future I plan to extend the core API to
support this use case.
2010-10-21 10:56:11 -04:00
Giovanni Campagna
0547a582d1 Add volume indicator
Add volume control indicator which uses API from gnome-volume-control
to interact with PulseAudio and shows both input and output volumes.
Also adds a small wrapper around libcanberra in ShellGlobal, used by the
volume indicator to provide auditive feedback.

https://bugzilla.gnome.org/show_bug.cgi?id=629455
2010-10-20 16:59:12 +02:00
Colin Walters
11db188fe9 Support xulrunner 1.9.3+
Add small wrappers around JS_AddValueRoot.
Add JS_BeginRequest in our custom code.

https://bugzilla.gnome.org/show_bug.cgi?id=630539
2010-09-30 12:43:12 -04:00
Maxim Ermilov
0e2ed0fb0b add shell_global_[un]set_cursor
This functions set/unset the cursor on the stage window.
https://bugzilla.gnome.org/show_bug.cgi?id=607821
2010-09-10 05:58:19 +04:00
Colin Walters
dddd97f6df introspection: Build with --warn-all --warn-error
* Use --warn-all, --warn-error
* Fix various broken gtk-doc
* Drop unused shell_get_event_related
* For header defines, we currently require them to end in _H to be skipped
* Drop the no-longer-necessary fix-meta-rectangle.py hack
* Move to the convention of using -private.h for headers that are,
  well, private.
* Add shell-wm-private.h
2010-09-07 13:07:52 -04:00
Dan Winship
adbf3b1c37 [ShellGlobal] add SHELL_STAGE_INPUT_MODE_FOCUSED
Add SHELL_STAGE_INPUT_MODE_FOCUSED, to move the keyboard focus to the
shell without grabbing the keyboard or mouse, and make
stage_input_mode into a GObject property so that (among other things),
callers can tell when MODE_FOCUSED reverts back to MODE_NORMAL.

https://bugzilla.gnome.org/show_bug.cgi?id=623429
2010-07-20 15:03:17 -04:00
Owen W. Taylor
ab0d57d6ca Use MetaRectangle for allocated returns
The conversion of GdkRectangle to a typedef for cairo_rectangle_int_t
in GTK+-3 makes it no longer a proper boxed type (it's still registered
boxed, but gobject-introspection doesn't know that.) So, switch to using
MetaRectangle, which is now registered as a boxed type by Mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=621845
2010-07-07 12:56:47 -04:00
Milan Bouchet-Valat
2799327c84 Migrate to GSettings
Use GSettings for all Shell configuration. GConf is kept to read
configuration from external programs (Metacity, Nautilus and Magnifier),
but ShellGConf is removed because it's mostly useless for the few calls
we still have. Also get rid of unused GConf code in ShellAppSystem.

A basic GConf schema is still used to override Metacity defaults and
configure Magnifier in a system-wide fashion. GConf is also used as
GSettings backend via the GSETTINGS_BACKEND environment variable.
All of this will be removed when these programs have been ported
to GSettings and able to use dconf.

GLib 2.25.9 is required. Schemas are converted to the new XML format,
and compiled at build time in data/ so that the Shell can be run from
the source tree. This also requires setting the GSETTINGS_SCHEMA_DIR
environment variable both when running installed or from source tree,
in src/gnome-shell.in and src/gnome-shell-clock-preferences.in.

https://bugzilla.gnome.org/show_bug.cgi?id=617917
2010-06-18 20:27:41 +02:00
Adel Gadllah
ccbf247970 Relayout on monitor layout changes
Currently we only relayout when the screen size changes, this gets
 the cases where a monitor gets added/removed but not when the primary
 monitor changes.

 We need to relayout on all monitor layout changes.

 Remove ShellGlobal::screen-size-changed signal as it is no longer used, Gdk is
 used to track changes now.

 A ShellGlobal::gdk-screen property is added for this purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=620377
2010-06-04 15:20:04 +02:00
Adel Gadllah
ce3f003e46 Call shell_global_maybe_gc() when no work is being done
Call shell_global_maybe_gc when idle when no other work is ongoing to free
up memory and improve performance by preventing the GC to kick in at less
convenient times.

See: https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_MaybeGC

https://bugzilla.gnome.org/show_bug.cgi?id=614725
2010-05-21 23:47:41 +02:00
Adel Gadllah
9fca747ef4 shell-global: Add shell_global_maybe_gc
Add a method to call JS_MaybeGC, see
https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_MaybeGC

https://bugzilla.gnome.org/show_bug.cgi?id=614725
2010-05-21 23:47:25 +02:00
Owen W. Taylor
e4e92a2b38 Add shell_write_string_to_stream()
Add a helper function to write a string as UTF-8 to a GOutputStream.
The signature of GOutputStream:

 gboolean g_output_stream_write_all (GOutputStream *stream,
                                     const void *buffer,
                                     gsize count,
                                     gsize *bytes_written,
                                     GCancellable *cancellable,
                                     GError **error);

Can't currently be handled by GJS.

https://bugzilla.gnome.org/show_bug.cgi?id=618189
2010-05-21 00:18:45 -04:00
Owen W. Taylor
a97b8c1947 Add events before and after stage paint
Add performance events:

 clutter.stagePageStart
 clutter.stagePageDone

to track frame repaints.

https://bugzilla.gnome.org/show_bug.cgi?id=618189
2010-05-20 23:41:46 -04:00
Owen W. Taylor
a9a513c621 Add "leisure function" capability
To support scheduling performance-measurement scripts that want to run
a number of actions in series, add shell_global_run_at_leisure() to run
a callback when all work is finished.

The initial implementation of this is not that accurate: we track
business in Tweener.js via new shell_global_begin_work(),
shell_global_end_work() functions, and we also handle the case
where the main loop is continually busy.

https://bugzilla.gnome.org/show_bug.cgi?id=618189
2010-05-20 23:21:44 -04:00
Dan Winship
fe542f8732 Add a hack to block calls to certain introspected functions
This is useful for keeping people from using methods that only fail in
certain circumstances, by making them fail in all circumstances
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=618918
2010-05-20 15:49:16 -04:00
Colin Walters
84716bccd4 Create ShellGlobal later to avoid connecting to X during build
The ShellGlobal initialization performs several actions like connecting
to the X server, ensuring directories exist, etc., that are problematic
because we were creating the object even when running the binary for
introspection scanning.  During compilation we may not even have X11
available in e.g. autobuilder type environments, and it's just a
bad idea to connect even if we do.

Avoid this by deferring creation of the ShellGlobal object
until the plugin is actually started.

Now that we're initializing things later, remove the connection to
screen changes, and initialize cached ShellGlobal state at the point
when the plugin is set.  The root pixmap actor is now sized initially
on creation too.  Instead of relying on screen-size-changed being
emitted on startup, explicitly invoke _relayout().

https://bugzilla.gnome.org/show_bug.cgi?id=618371
2010-05-17 13:04:38 -04:00
Adel Gadllah
410dfb2da3 Use gdk_screen_get_primary_monitor on gtk-2.20.1+
Starting with gtk-2.20.0 there is a gdk_screen_get_primary_monitor,
which supports querying the primary monitor from xrandr.

But due to a sorting bug and lack of heuristics in the fallback path,
it isn't really useable.

Those bugs are fixed in gtk-2.20.1, so use it when building with
gtk-2.20.1+.

https://bugzilla.gnome.org/show_bug.cgi?id=608647
2010-05-12 09:35:32 +02:00
Joseph Scheuhammer
7b7c34a399 Adds magnifier functionality to gnome-shell.
Adds the ability to create one or more zoom regions that show magnified or
enhanced views of the desktop.  The magnifier provides options for:
* magnification factor,
* four mouse tracking modes common to screen magnifiers,
* positioning the magnified view in one of four screen location, or full screen,
* crosshairs to accentuate the position of the mouse,
* user preferences persistence via GConf (schemas in
  .../data/gnome-shell.schemas).
* a DBus API to allow other processes to drive the magnifier as a service.

https://bugzilla.gnome.org/show_bug.cgi?id=595507
2010-05-11 14:52:25 -04:00
Florian Müllner
b09b30616d Fix userdata directory creation
When creating the directory to store user data, XDG_DATA_HOME is
not guaranteed to exist. Also, the standard mandates permissions
of 0700 for the directory.

https://bugzilla.gnome.org/show_bug.cgi?id=617555
2010-05-06 13:47:00 +02:00
Florian Müllner
b1486f54c8 [ShellGlobal] Change location for user files to XDG_DATA_HOME
While the extension system already uses an XDG location (XDG_CONFIG_HOME),
other components use the deprecated $HOME/.gnome2 directory.
Replace both with XDG_DATA_HOME - the existing data (app usage stats,
looking glass history and extensions) is not migrated to the new location.

https://bugzilla.gnome.org/show_bug.cgi?id=617555
2010-05-05 20:36:52 +02:00
Dan Winship
d42263c1bc Change shell_global_get_modifier_keys to shell_global_get_pointer.
We can't use gdk_display_get_pointer/gdk_window_get_pointer from gjs
when XKB is active. We already had a wrapper that did the
get-modifier-state part of that, but some places also need the
get-pointer-location part of it. So update our wrapper to return both,
and update js code to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=613428
2010-04-08 14:51:45 -04:00
Colin Walters
cbcbd11ba0 [ShellGlobal] Fix double-free in get_primary_monitor 2010-04-05 11:39:37 -04:00
Adel Gadllah
bae07700a1 shell_global_get_primary_monitor: Use variable to store number of monitors
See https://bugzilla.gnome.org/show_bug.cgi?id=608647#c5
(forgot to add it before commiting).
2010-04-04 18:13:28 +02:00
Adel Gadllah
ca13cec01c Rework shell_global_get_primary_monitor
Currently shell_global_get_primary_monitor just returns the first screen,
in the list as primary.

This is not always correct as the first screen reported by mutter isn't always,
the first one listed by RANDR.

Use gdk_screen_* to query the monitor information and add a heuristic to prefer
LVDS displays (similar like in done for gnome-panel) to prefer the laptop's
internal screen over external displays.

https://bugzilla.gnome.org/show_bug.cgi?id=608647
2010-04-04 18:06:56 +02:00
Adel Gadllah
d173f9e19d shell-global: Fix get_focus_monitor returning the incorrect screen
When the window's top-left corner is the same as the monitor's top-left
corner the check in shell_global_get_focus_monitor fails to detect that.

Use <= rather than < to fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=613944
2010-03-25 22:04:43 +01:00
Colin Walters
c4e0e4197d [ShellGlobal] Add shell_global_breakpoint
This is useful for debugging with gdb.
2010-02-23 18:51:27 -05:00
Owen W. Taylor
1f1f4432f6 Use gjs_context_get_native_context()
When exported into a public header, gjs_context_get_context() was
renamed to gjs_context_get_native_context(). Adapt, and remove
local prototype.

https://bugzilla.gnome.org/show_bug.cgi?id=610845
2010-02-23 11:54:56 -05:00
Florian Müllner
94d3e27c53 [Overview] Fix tiled background images
Tiled backgrounds are only displayed once in the upper left corner when
in the overview - they should be tiled just like outside the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=610203
2010-02-17 17:34:38 +01:00
Adel Gadllah
4749393ab5 Remove panel-run-dialog/main-menu handling from shell-global
This is handled by the shellwm (takeover_keybinding) nowdays.

https://bugzilla.gnome.org/show_bug.cgi?id=610039
2010-02-16 16:50:40 +01:00
Dan Winship
8e759d7f32 Initialize global->root_pixmap to the stage color
Fixes drawing of the overview in the case where there is no root pixmap
(eg, --xephyr mode).

(And the workaround for not drawing an unintialized ClutterTexture can
be removed now, since the texture will always have been initialized.)

https://bugzilla.gnome.org/show_bug.cgi?id=609339
2010-02-08 14:47:04 -05:00
Maxim Ermilov
86515f3943 show background when nautilus isn't drawing the desktop.
If window with type Meta.WindowType.DESKTOP doesn't exist, then draw
background.
https://bugzilla.gnome.org/show_bug.cgi?id=591912
2010-02-03 22:52:25 +03:00
Colin Walters
b1007ed811 Add shell_global_gc
Primarily useful for debugging.  This was originally a patch against
gjs: https://bugzilla.gnome.org/show_bug.cgi?id=595323

But rather than add a random toplevel module just for this function
effectively, we can easily enough define it here.  Adding toplevel
modules to GScript should have a bit more formal process to it.

https://bugzilla.gnome.org/show_bug.cgi?id=608095
2010-02-01 16:08:43 -05:00
Maxim Ermilov
d9008054cf Handle resolution changes
Added signal 'screen-size-changed' to ShellGlobal.
Connect to this signal in main.js and run the _relayout() method.
If Overview or calendar are visible when this signal emit, they will be hiding.
https://bugzilla.gnome.org/show_bug.cgi?id=584526
2010-01-19 21:32:36 +03:00
Florian Müllner
ccc6a23f68 Fix missing translations for 'time ago' strings
Replace ngettext with dngettext and set the correct translation
domain, so gnome-shell's domain is searched for translations
rather than mutter's.

https://bugzilla.gnome.org/show_bug.cgi?id=597882
2010-01-15 17:14:03 +01:00
Dan Winship
11276a3505 Initial implementation of the message tray and notification daemon
From the message-tray branch. Most of the UI parts were written by
Marina, and most of the D-Bus parts by me.
2010-01-13 15:13:20 -05:00
Colin Walters
2cb4dfb4a4 [lookingGlass] Add primitive extensions list
In the future this should be more like the Firefox Addons UI
probably with enable/disable/update checking, but stub it out
here for now.

https://bugzilla.gnome.org/show_bug.cgi?id=599661
2009-12-18 11:20:05 -05:00
Colin Walters
aa9d3515a1 Add extensionSystem
Consumer documentation will live at http://live.gnome.org/GnomeShell/Extensions

In terms of implementation; basically we load extensions from the well-known
directories.  Add a GConf key to disable extensions by uuid.  There is a new
option --create-extension for the gnome-shell script which takes a bit of
interactive input, sets up some sample files, and launches gedit.

No extensions UI in this patch; that will come later.

https://bugzilla.gnome.org/show_bug.cgi?id=599661
2009-12-18 11:19:59 -05:00
Colin Walters
42757a0c87 Move Main.currentTime() and Main.createAppLaunchContext() into ShellGlobal
Primarily motivated by wanting these functions accessible from C.

https://bugzilla.gnome.org/show_bug.cgi?id=603522
2009-12-15 15:54:38 -05:00
Dan Winship
dd8f05c81d include "config.h" in all .c files
Also, fix shell-global.c to actually compile with config.h included.

Was supposed to fix bug 602802, but doesn't...
2009-11-24 09:15:35 -05:00
Dan Winship
985d707788 Port ShellStatusMenu to javascript
https://bugzilla.gnome.org/show_bug.cgi?id=601458
2009-11-13 14:21:31 -05:00
Owen W. Taylor
627f86a9dc shell-global-private.h fixes:
- Include private header so shell-global.c compiles
- Move _shell_global_set_plugin to private header
2009-10-28 12:59:01 -04:00
Colin Walters
baf823c466 Store GjsContext pointer in ShellGlobal
Future functionality in ShellGlobal needs access to the GjsContext.

https://bugzilla.gnome.org/show_bug.cgi?id=599561
2009-10-28 12:31:58 -04:00
Owen W. Taylor
ff39edd1ee Deal with unknown flags from ClutterEvent.get_state()
When we get a ClutterModifierType from Clutter, it might contain
bits not in the enumeration. See bug 59771 for a similar problem
with GdkModifierType.

Add a wrapper Shell.get_event_state() around clutter_event_get_state()
to mask these bits out and only return approved bits.

https://bugzilla.gnome.org/show_bug.cgi?id=597735
2009-10-07 17:22:37 -04:00
Dan Winship
439daf828f [AppSwitcher] add a workaround for a gjs problem with GdkModifierType
gdk_display_get_pointer() sometimes returns values for the mask that
aren't part of the GdkModifierType enumeration, which gjs doesn't like
(bug 597292). Work around that by adding a C wrapper that strips out
the extra flags.

https://bugzilla.gnome.org/show_bug.cgi?id=597559
2009-10-06 16:07:37 -04:00
Colin Walters
459a3b18f2 Add a "datadir" property
Will be used to load stylesheets from main.js.

https://bugzilla.gnome.org/show_bug.cgi?id=591245
2009-10-01 14:41:16 -04:00
Dan Winship
2b78d5bd5d Improve support for multihead setups
Fix panel, app switcher, and looking glass to limit themselves to the
primary monitor, and run dialog to limit itself to the monitor
containing the currently-focused window.

The overview is also limited to the primary monitor now (with the
other monitors being blacked out), although the workspaces within the
overview are shaped like the full "screen" (the bounding box of all
monitors). To be fixed later.

https://bugzilla.gnome.org/show_bug.cgi?id=593060
2009-10-01 13:46:03 -04:00
Colin Walters
37ee16b34d Use clutter_event_get_* instead of ShellGlobal
Before Clutter gained accessors for event information, we had
shell_global_ functions.  Now that Clutter has them, use them and
delete the ShellGlobal code.

http://bugzilla.gnome.org/show_bug.cgi?id=594561
2009-09-08 17:58:13 -04:00
Owen W. Taylor
1340413740 Fix hang when clicking on the user status menu in the overview
shell-global.[ch]: Add shell_global_display_is_grabbed() that
  uses the newly added meta_display_get_grab_op() to check
  for existing grabs.
shell-status-menu.[ch]: Add shell_status_menu_is_active() to
  check if the menu is popped up. Check for active grabs before
  popping the menu up. Use gtk_menu_popdown() rather than
  gtk_widget_hide(). Remove an excess gtk_widget_show() and
  some excess casts.
panel.js: Check whether the status menu is popped up after button
  release, and if it's not popped up, unhighlight the button.

Reported by Nuno Donato
http://bugzilla.gnome.org/show_bug.cgi?id=593362
2009-08-28 12:34:04 -04:00
Owen W. Taylor
799f56fe87 Use new plugin-modality functionality in Mutter
We now have functionality in Mutter to grab the keyboard on behalf
of a plugin. This avoids interactions with the key handling code
in Mutter that could leave the user with an inconsistent state
and no way to get out of it.

src/shell-global.[ch]: Change shell_global_grab_keyboard() and
  shell_global_grab_keyboard() to shell_global_begin_modal()
  shell_global_end_modal() and call mutter_plugin_begin_modal()
  mutter_plugin_end_modal() rather than directly grabbing the
  keyboard.
main.js: Call global.begin_modal/end_modal from Main.startModal()
  and Main.endModal()
altTab.js; Remove call to Main.startModal() - we're letting Mutter
  handle modality for Alt-Tab.
main.js lookingGlass.js overview.js runDialog.js: Rename
  Main.startModal() to Main.beginModal() for consistency with
  naming in mutter and ShellGlobal.

http://bugzilla.gnome.org/show_bug.cgi?id=590686
2009-08-26 14:07:02 -04:00
Colin Walters
7469a2626a Bug 591859 - Use glib/gi18n-lib to get correct gettext package
We need to use the -lib variant which in turn uses the
GETTEXT_PACKAGE define, because the default translation
domain is actually mutter, not gnome-shell.
2009-08-17 08:53:59 -04:00
Colin Walters
ebd6f4bc8f appDisplay: Reimplement well layout to be width-independent
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.
2009-08-08 15:47:49 -04:00
Owen W. Taylor
d243634602 Fix compiler warnings
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
2009-08-06 16:46:55 -04:00
Jon Nettleton
a439a58f13 Remove taskpanel
The new design doesn't have the task panel at the bottom; remove it.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-31 17:42:49 -04:00
Colin Walters
29ffa46d08 Move drawing functions from shell-global into new shell-drawing.c file
Just to avoid shell-global.c bloat.
2009-07-31 17:26:47 -04:00
Colin Walters
66e48da7cb Bug 589260 - Don't replace panel in Xephyr mode
Avoid grabbing the org.gnome.Panel name if we're running in
Xephyr, since that affects the main desktop.
2009-07-29 17:47:34 -04:00
Colin Walters
96cf9c739e Avoid ellipsizing app names; Draw glow around running
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.
2009-07-27 12:45:22 -04:00
Marina Zhurakhinskaya
f24169735a Fix updating last visited time for the doc display 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.
2009-07-22 18:57:05 -04:00
Colin Walters
b4cf178cc5 Display last visited time as docInfo description
It's useful information, and takes up some of the blank space.
2009-07-21 23:05:08 -04:00
Colin Walters
fdd9b85448 If org.gnome.Panel exists on the bus, replace it rather than using gdb
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.
2009-07-21 13:29:49 -04:00
Colin Walters
5d067ec718 Better caching for document textures and information
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.
2009-07-09 13:58:45 -04:00
Colin Walters
cc2d3fd56d Major rework of application data structures and caching
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.
2009-07-08 11:33:47 -04:00
Colin Walters
00407d6971 Explicitly include gio/gio.h in ShellGlobal
Because we use GFile.
2009-07-06 23:13:58 -04:00
Colin Walters
94f92072c2 ShellAppMonitor now always assocates windows with desktop files
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.
2009-06-30 16:20:24 -04:00
Marina Zhurakhinskaya
9faf161aae Fix up horizontal gradient code and its use
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.
2009-06-30 15:38:17 -04:00
Marina Zhurakhinskaya
1154a1e8d7 Add a results pane in the overlay
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]
2009-06-30 15:38:16 -04:00
Colin Walters
4314c6e57f Close memory leaks in ShellAppMonitor, ShellAppSystem, ShellTextureCache
Unref'ing the GdkPixbuf is particularly critical.  Some smaller fixes
also included.
2009-06-16 17:31:47 -04:00
Siegfried-Angel Gevatter Pujals
e478cc4c4e Fix shell_get_thumbnail* to not be specific for GtkRecentInfo items
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.
2009-06-15 20:10:34 -04:00
Owen W. Taylor
b131ecc42a Work around a Clutter crash when there is no root pixmap
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
2009-06-08 17:10:11 -04:00
Owen W. Taylor
315da57c97 Add the root pixmap source actor to the stage
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
2009-06-08 13:49:52 -04:00
Colin Walters
d024dbd779 Bug 582248 - Async loading of pixbufs and icon caching
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.
2009-05-20 11:22:56 -04:00
Dan Winship
10afe46195 Add an initial implementation of the sidebar
This still needs design love, and none of the current widgets should be
considered finalized, but it shows the basic ideas.

http://bugzilla.gnome.org/show_bug.cgi?id=581774
2009-05-15 17:04:18 -04:00
Dan Winship
84d469c1f9 Deal with thumbnail failure correctly
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
2009-05-05 17:33:43 -04:00
Owen W. Taylor
432ad0f451 Avoid clobbering the root window event mask
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)
2009-05-01 19:40:12 -04:00
Dan Winship
4a5873dd22 Create a more extensible/organized strut/input_area management system.
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.
2009-04-30 14:57:13 -04:00
Milan Bouchet-Valat
17a4a3a949 use a global config dir (for app monitor)
Ensure a configuration dir exists, and provide its path as 'configdir' property of ShellGlobal. This will be used by ShellAppMonitor.
2009-04-29 11:05:03 -04:00
Marina Zhurakhinskaya
82cf98740a Bug 578178 – Show large previews for image files
Use the actual image from the file for expanded mode previews for image files. Use the pixbuf loader to set the appropriate image size as soon as the image is prepared, but before it is loaded, to avoid loading large images. Apply the pixbuf orientation setting so that the image is properly rotated. Preserve the original size of the image if its dimensions are smaller than the space available.

Make sure we provide the accurate available width for the details actor. This
width has to exclude the padding and border width. Also provide the available height for the details actor.
2009-04-28 15:35:36 -04:00
Owen W. Taylor
56644dfada Close file descriptors on re-exec
Use code copied from GLib to close all file descriptors before we reexec ourselves
on the restart Alt-F2 command. This fixes serious memory leaks when we have mapped
graphics buffers.

http://bugzilla.gnome.org/show_bug.cgi?id=579776
2009-04-22 15:08:07 -04:00
Sander Dijkhuis
7c8cb8450c Bug 578584 - Use the wallpaper for the overlay background
The overlay looks nicer with the root window pixmap drawn on the
background. It is scaled up to twice the size, with positioning
based on the rule of thirds.

The sideshow animations shown when entering or leaving the
overlay and toggling the extended view were implemented by
Marina Zhurakhinskaya. They replace the old method of having a
black rectangle behind the workspaces that partly covers the
sideshow during transitions.

configure.ac: Add gdk-x11, clutter-x11 and clutter-glx modules.
overlay.js: Add a root window pixmap actor, make sideshow width
    definitions more logical, replace the way the sideshow
    animates when entering or leaving the overlay.
workspaces.js: Remove the backdrop, add helper functions for the
    overlay transitions.
shell-global.[ch]: Add a method that creates an actor displaying
    the root window pixmap and returning clones of it.
2009-04-22 02:46:36 +02:00
Marina Zhurakhinskaya
5fbc0d4a56 Bug 577338 – Show item details on click in the expanded view
Change the overlay behavior to display more details about an item on single
click and launch it on double click.

When the item is clicked on in the expanded view, the details are shown in the
area on the right that is allocated for showing details. The details pop-up is
not shown for the item that was clicked on, but it is shown for other items on
hover and for the item that was clicked if the mouse pointer is moved back to
it.

Both hovering and single clicking results in the details pop-up being shown in
the regular view. (Single clicking actually doesn't do anything in the regular
view, but the details pop-up is shown due to hovering within the time it takes
to perform a single click.)

The overlay now uses 3 columns on the wide screen for displaying items in the
expanded view. This allows keeping the size of the details area the same for
expanded and regular views.

Add shell_get_button_event_click_count() to shell-global.[hc] to retrieve
the click count for button press and release events.

Add selectedItemDetails public variable actor to the generic display to
contain the details of the selected item and be shown in the overlay when
it is in the expanded view mode.

Fix the bug when the sideshow section would loose selection in the expanded
view if it did not have any items, and would not regain it if it was repopulated
with some items (e.g. when the search string changes).

The sideshow no longer takes overlay parent and width as constructor arguments.
It is added to the overlay inside the overlay code and manages its own width
instead (which is ok, since it is pretty much a private class within overlay).

Clean up the way selection is moved when an item is launched in order to have
selection on click and activation on double click be implemented in a similar
fashion. An unneeded _activatedItem variable in generic display was removed,
and the selected item is activated instead when necessary. The flow of processing
signals changed so that generic display no longer waits for the selection from
a different sideshow section to be removed before selecting an item that was
clicked on. This removed the need for doActivate() function.
2009-03-31 14:12:33 -04:00
Sander Dijkhuis
2b9b600710 Bug 574702 - Give the panel a gradient background and shadow
The panel looks nicer when it is drawn as a semi-transparent gradient
above the background color.

shell-global.[ch]: Add a function that creates vertical gradient actors.
panel.js: Change the look of the panel and put the tray in a framed box.
overlay.js: Extend the overlay background to behind the panel.
2009-03-24 15:20:16 -04:00
Owen W. Taylor
0f7abf96a7 Port to Clutter-0.9
tools/build/gnome-shell.modules: Point  at master branch of Clutter (0.9)
  and make gobject-introspection a dep of Clutter.
configure.ac src/Makefile.am: Use Clutter-0.9
js/ui/button.js js/ui/genericDisplay.js js/ui/overlay.js js/ui/panel.js
js/ui/runDialog.js js/ui/workspaces.js src/shell-status-menu.c:
  Use ClutterText instead of ClutterLabel and ClutterEntry
js/ui/workspaces.js js/ui/genericDisplay.js: Use ClutterClone instead
  of ClutterCloneTexture
src/shell-global.[ch]: Add Shell.get_event_key_symbol() to workaround
  unaccessibility of clutter_key_event_symbol() to use.
js/runDialog.js js/overlay.js: Use Shell.get_event_key_symbol() as
  appropriate.
2009-02-23 14:53:06 -05:00
Colin Walters
e2b246a006 Bug 570641 - Use null input area when a GTK+ grab is operative
This ensures that any popup windows we create in process, such as
the user status menu, will get X events delivered even if the user clicks
on the stage input area.
2009-02-06 17:54:50 -05:00
Marina Zhurakhinskaya
b2fbf5a2d8 shell-global.c: remove a log message about missing 'Categories' key in the desktop file, as this key is not required
main.js: set desktop environment to "GNOME" so that GIO can determine correctly which applications should be shown in the menus.

appDisplay.js: filter out applications that should not be shown in the menus, check if get_executable() for GAppInfo is not null before using it   

svn path=/trunk/; revision=163
2009-01-22 21:28:19 +00:00
Marina Zhurakhinskaya
9949d75fcc Get categories from the desktop files for all applications
and use them when finding matching applications for the search in the overlay mode.

svn path=/trunk/; revision=159
2009-01-21 21:50:57 +00:00
Colin Walters
70a3434b5a Add a panel containing tasklist to bottom screen
This is implemented as a separate process, since creating and running
toplevel windows from inside Metacity has issues.

We now grab a DBus name, and exec the child process.  The child monitors
our name to know when to exit.

svn path=/trunk/; revision=153
2009-01-19 23:21:57 +00:00
Colin Walters
5afcf07782 Merge branch 'workspace-salon'
Conflicts:
	src/shell-global.c

svn path=/trunk/; revision=152
2009-01-19 23:06:59 +00:00
Owen Taylor
244555f3ae Fix include path to libgnomeui/gnome-thumbnail.h
Remove a stray libgnomeui-2.0/ (Michael Monreal)

svn path=/trunk/; revision=150
2009-01-17 13:44:44 +00:00
Marina Zhurakhinskaya
849ddbd3f6 Display thumbnails of recent files in the overlay mode by using GnomeThumbnailFactory to get them. Fall back to the system icon for the file type provided by GtkRecentInfo when a thumbnail is not available.
svn path=/trunk/; revision=143
2009-01-09 01:09:35 +00:00
Dan Winship
54d8f3b27d Add (+) and (-) icon artwork, and a little bit of infrastructure for them
svn path=/trunk/; revision=136
2008-12-22 22:05:56 +00:00
Colin Walters
6a1e408c44 Add magic 'restart' command to run dialog which re-executes
This is immensely convenient for debugging.  The shell global reexec_self
only works on Linux, sue me.

http://bugzilla.gnome.org/show_bug.cgi?id=565037

svn path=/trunk/; revision=130
2008-12-18 20:57:37 +00:00
Owen Taylor
c12de59864 Add a concept of "going modal" by grabbing the keyboard
shell-global.[ch]: Replace shell_global_focus_stage()
  with shell_global_grab_keyboard()/shell_global_ungrab_keyboard()
main.js: Add startModal()/endModal() functions to go modal and
  undo that.
run_dialog.js overlay.js main.js: Use startModal() for the overlay
  and for the run dialog.

http://bugzilla.gnome.org/show_bug.cgi?id=561880

svn path=/trunk/; revision=83
2008-11-24 19:07:18 +00:00
Dan Winship
aa61fdbc53 revert some broken bits from previous patch that weren't supposed to have
been committed

svn path=/trunk/; revision=74
2008-11-21 15:33:00 +00:00
Dan Winship
7dba934b96 add the initial framework of a window management interface. #561724
svn path=/trunk/; revision=70
2008-11-21 14:02:09 +00:00
Marina Zhurakhinskaya
7cad9a7ca0 Add a convenience function for setting an image for ClutterTexture based on GdkPixbuf.
svn path=/trunk/; revision=67
2008-11-21 00:39:14 +00:00
Owen Taylor
48a2cca476 Add a 'screen' property to ShellGlobal
Add a screen property to ShellGlobal so Javascript code can get
access to the MetaScreen.

http://bugzilla.gnome.org/show_bug.cgi?id=561297

svn path=/trunk/; revision=61
2008-11-19 22:54:42 +00:00
Owen Taylor
8f615e833e Add shell_global_focus_stage()
Add a a method shell_global_focus_stage() to set the
input focus to the stage window, so that Clutter gets
keyboard events.

Adapted from patch in Bug 561299 from Colin Walters

svn path=/trunk/; revision=59
2008-11-19 19:54:17 +00:00
Marina Zhurakhinskaya
679365f1c1 Add a button object that highlights a button area when it is moused over and transitions it to a different color when the button is pressed in. Use this button object for the panel's "Activities" button.
Add some comments, TODO items, and type fixes to the code.

svn path=/trunk/; revision=52
2008-11-15 00:44:11 +00:00
Owen Taylor
f546d92033 Hide the group containing the windows while overlay is up
When we are animating the overlay, we don't want to be continually
redrawing the (obscured) window actors.

src/shell-global.c: Add 'window-group' property to expose the group
  holding the window actors.
js/ui/overlay.js: Hide the window group while the overlay is up.

svn path=/trunk/; revision=39
2008-11-08 19:33:33 +00:00
Colin Walters
19070be3ba Run gnome-terminal on alt-f2
svn path=/trunk/; revision=36
2008-11-07 18:42:23 +00:00
Owen Taylor
e624b2a241 First stab at showing windows in the overlay
shell-global.[ch]: Add shell_global_get_windows() to get
  the list of all MutterWindow for the  screen
Makefile.am: Include the metacity typelib so that we can
  reference the MutterWindow type
js/ui/overlay.js: Cascade the open windows, scaled down
  in the overlay

svn path=/trunk/; revision=24
2008-11-02 04:18:41 +00:00
Owen Taylor
9c4d104630 Add annotations to fix return-value transfer for shell_global_get()
Default transfership for a GObject return value is 'full', override
it to 'none' for a singleton getter.

svn path=/trunk/; revision=12
2008-10-31 18:24:29 +00:00
Owen Taylor
7d6896a669 Add ShellGlobal.stage property
Add a property to get the root stage for the scene graph.

svn path=/trunk/; revision=8
2008-10-31 18:04:38 +00:00
Owen Taylor
2fd4c9058d Extend ShellGlobal object with more properties
* Add screen-width, screen-height, overlay-group properties
* Add set_stage_input_area() function
* Fix main.js to rotate DRAFT properly

svn path=/trunk/; revision=6
2008-10-31 15:20:54 +00:00
Owen Taylor
4ba985b484 Initial commit
A plugin for metacity-clutter (mutter) that initializes Javascript
and via Javascript adds an object to the mutter scene graph.

src/gnome-shell-plugin.c: metacity-clutter-plugin
src/shell-global.[ch]: Simple global-information object
js/: Directory for javascript
scripts/start-in-Xephyr: Launch metacity with our plugin
  "nested" within an Xephy X server

svn path=/trunk/; revision=2
2008-10-31 04:22:44 +00:00