Commit Graph

247 Commits

Author SHA1 Message Date
Colin Walters
5880b3b0ed [ShellButtonBox] Add event to activate signal
This allows access to things such as keyboard modifier state and
event time cleanly.

http://bugzilla.gnome.org/show_bug.cgi?id=594565
2009-09-08 17:58:13 -04:00
Colin Walters
25410a730e Bug 591763 - Add application window menu
When we have multiple windows for an application, implement the following
behavior:

* On click + immediate release, go to the most recently used
* On click, hold for 0.6s, pop up a menu with windows, filtering
  the window list to just those windows.
  Mouse over on the window list highlights the moused-over window.

Implement this by splitting well item into InactiveWellItem
and RunningWellItem, sharing a base class BaseWellItem.
2009-09-08 14:31:44 -04:00
Colin Walters
22c445cffc Add ShellMenu
An object with methods and signals useful for implementing popup menus.
2009-09-08 14:31:43 -04:00
Jon Nettleton
7f88e02a26 Convert on_tree_changed to a gboolean returning false.
This fixes commit 0a29cf6195 and
g_timer_add_full running in an endless loop.

http://bugzilla.gnome.org/show_bug.cgi?id=592608
2009-09-07 11:13:38 -04:00
Jon Nettleton
0a29cf6195 Compress notifications of menu changes with a timeout.
GMenu currently gives us a separate notification on the entire
menu tree for each node in the tree that might potentially have
changed. (See http://bugzilla.gnome.org/show_bug.cgi?id=172046.)
Compress these with a timeout to avoid doing a lot of extra work.

http://bugzilla.gnome.org/show_bug.cgi?id=592608
2009-09-04 19:24:47 -04:00
Colin Walters
52abf266c0 Redo AppWell glow to be based on a based on a .png instead of cairo
Instead of drawing an ellipse, use a hand-drawn .png file which
looks a bit less regular and blends better.
2009-09-04 17:42:10 -04:00
Colin Walters
0a17a28608 Add shell_button_box_fake_release
The application menu code wants to do a popup after a given timeout
while holding.  We can implement that by adding a function to
manually break the grab held by the button box.

Freeze+thaw around the hover and pressed property notification on leave
since handlers may want to depend on the pressed state on a hover
transition.
2009-09-02 15:01:33 -04:00
Colin Walters
926643b025 Add shell_texture_cache_pixbufs_equal
Mutter is currently creating separate pixbufs for window icons;
use this to analyze them.
2009-09-02 14:54:49 -04:00
Steve Frécinaux
0245a0cd0e Do not display windows with skip-taskbar hint in overview.
This fixes the bug where the empathy buddy list is always visible on the
last workspace it was shown on, even if it was closed.
2009-08-31 21:35:23 +02:00
Steve Frécinaux
bcc3dc0711 Consolidate window tracking filters between app monitor and overview.
The windows we considered for both the app monitor and the overview
workspaces were the same, but the code was duplicated once in C, once
in Javascript.
2009-08-31 21:35:23 +02:00
Owen W. Taylor
3d499219da Use AM_PATH_PYTHON to find Python >= 2.5
On OpenSolaris /usr/bin/python is 2.4; use AM_PATH_PYTHON to find
a newer Python. (The PYTHON environment variable can also be set
before running configure to override the search.)

http://bugzilla.gnome.org/show_bug.cgi?id=578196
2009-08-31 13:42:06 -04:00
Colin Walters
94b26888cf Build tweaks
Add .AUTOPARALELL which is my GNU-make fix for projects to specify
that the build is parallel-safe, and to automatically parallelize.

Add a missing dependency on built sources, and specify --libtool
to be safe.
2009-08-30 18:08:19 -04:00
Owen W. Taylor
0fd6bc5172 ShellButtonBox: only listen to button 1 and single clicks
Only mouse button 1 is supposed to activate button controls; other
mouse buttons should do nothing unless there is a context menu.

Checking the click count is important, since double-clicks will
otherwise look like unpaired button presses.

http://bugzilla.gnome.org/show_bug.cgi?id=593504
2009-08-29 15:20:18 -04:00
Owen W. Taylor
0e3cea41e0 ShellButtonBox: Use default handlers, not self-connections
There's seldom a good justification for connecting to signals on
yourself rather than using the default handler slots in the class.

But in particular using the default handler slots means that
an application can connect to ::button-press-event and get in
before the default handling, to implement a button that does
something on press.

http://bugzilla.gnome.org/show_bug.cgi?id=593503
2009-08-29 15:20:18 -04:00
Owen W. Taylor
45c600cd25 Add an active property to ShellButtonBox
Add an 'active' property to ShellButtonBox. This allows ShellButtonBox
to be used as a "toggle button". It's up the application to connect
it to the ::activate signal; there's no default handling of this.

(It's seldom that the only time you want to toggle a toggle button
through the user interface, so you need some connection to the backend
data store in any case. Removing the default handling all-together
prevents weird interactions.)

When we have built-in styling for ShellButtonBox the 'active' state
would be one of the elements that would be affect the styling.

http://bugzilla.gnome.org/show_bug.cgi?id=593502
2009-08-29 15:20:18 -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
3adec65e20 Remove pre-GNOME-2.26 panel-replacement code
gnome-shell.in: Remove the code to replace gnome-panel by attaching
  to it with GDB; this was always problematical (required gdb, debug
  symbols, finding the pid of gnome-panel, etc.)

gnome-shell-build-setup.sh: Require 2.26 to be in place before building
  the shell; remove gdb from the list of required packages.

http://bugzilla.gnome.org/show_bug.cgi?id=593325
2009-08-28 12:34:04 -04:00
Owen W. Taylor
d116f707c5 Clear save_id when removing idle_save_application_usage()
When we remove the timeout for saving application usage when application
usage is disabled, set the save_id member variable to 0.

http://bugzilla.gnome.org/show_bug.cgi?id=589676
2009-08-28 12:34:04 -04:00
Colin Walters
bf680fdc7c New class ShellButtonBox
This is a Box subclass which adds several signals useful for implementing
"button like" behavior, such as hover and pressed states, as well as
click activation on release.
2009-08-27 18:05:41 -04:00
Owen W. Taylor
851bf18265 Restore GNOME based on GNOME configuration
Instead of using pidof to find what was running when we started,
and then hacking in a restart with hardcoded paths in /usr/bin,
approximate how GNOME starts the panel and window manager.

This fixes restarting Compiz correctly:
 http://bugzilla.gnome.org/show_bug.cgi?id=593184

And restarting gnome-shell correctly:
 http://bugzilla.gnome.org/show_bug.cgi?id=591171
2009-08-27 15:33:47 -04:00
Owen W. Taylor
452e98e3bc Require an explicit --xephyr option
Instead of starting Xephyr automatically, require --xephyr to be
passed explicitly.

This makes the operation easier to understand and has the benefit
of allowing running in Xephyr mode when some other window manager
(like gnome-shell!) is running. We also want to emphasize that
Xephyr is a development tool, and not a good preview of the
user-interface.

http://bugzilla.gnome.org/show_bug.cgi?id=592881
2009-08-27 15:33:47 -04:00
Colin Walters
3cb54f6707 Fix allocation implementations for ShellStack and ShellDrawingArea
In both, using our allocation directly for the child is wrong; we
should create a new allocation that's our width and height.

In ShellDrawingArea, also need to chain up to parent.
2009-08-27 13:11:19 -04:00
Colin Walters
ed7881d6c9 [AppMonitor] Handle window title changes causing mapping changes
For Firefox/OpenOffice, right now we have a workaround in the
code where we look at their "title" property.  However, we
weren't monitoring that property for changes, and I'm fairly
certain Firefox at least was mapping a window and then very
quickly changing its title after.  So we need to handle
dynamic changes.

Split out the wm_class mapping from the title hack.  It was
messy and weird to have the two mixed because they're not
at all related, and we're not trying to handle WM_CLASS changes
right now.

Explicitly connect to notify::title in the case where we had
a title fallback.  When a title changes, just treat it as
an add+remove.

In the Application Menu area in the panel, hook up to app-added
and app-removed so we get notification of the active app changing.
2009-08-27 02:22:25 -04:00
Colin Walters
ea1a45a878 Also remove libtidy-1.0.la from Makefile 2009-08-27 02:18:55 -04:00
Colin Walters
003807334b Delete Tidy
It wasn't used any more.
2009-08-27 02:00:23 -04:00
Colin Walters
24a5c3c19a Add "mozilla" as a vendor prefix
Clean up the vendor prefix handling a bit, and add "mozilla" so that
we pick up "mozilla-firefox.desktop" from Firefox's (recent?) change
to have a WM_CLASS of "Firefox".
2009-08-27 01:49:15 -04:00
Colin Walters
62b2d69c2b Bug 592402 - Better handling of Nautilus window
Separate the application monitor logic for "tracking" and "usage tracking".
The first means we associate an application with a window.  The second
means we count focus time inside that window, and consider the window
interesting from a user point of view.

(Really, should probably split ShellAppMonitor into two classes along
 this line, with the second consuming the first).

For the purposes of counting running applications and returning
the list of open windows for an application, skip not-usage-tracked
windows.

Together this allows us to associate the Nautilus desktop window
with the nautilus.desktop, but not show "File Manager" open all
of the time.
2009-08-27 01:41:25 -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
Owen W. Taylor
af9ab5dbb6 Only respawn if gnome-shell exits abnormally
If Mutter exits with an exit status of 0, then that most likely
means that it was replaced by another window manager and we shoudln't
try to start the previous window manager and the panel.

(We don't actually know about the panel, but assume that if someone
is replacing us they know what they are doing.)

When Mutter exits with a signal, we know we want to restart.

When Mutter exits with a non-signal non-zero exit status, it's
ambiguous - we could be exiting because we lost the connection to
the X server, or because of a assertion failure in gnome-shell.
We assume the latter; if the X server is gone, all that will happen
is a bit of noise.

To know why Mutter exited accurately, we always wait() and
kill() the Mutter process, and then, if running in Xephyr, clean up
Xephyr afterwards. This has the nice side effect of exiting when
gnome-shell does and not forcing the user to close Xephyr manually.

http://bugzilla.gnome.org/show_bug.cgi?id=591171
2009-08-25 19:01:42 -04:00
Colin Walters
58690c210e [ShellAppSystem] fix missing break; in _unref 2009-08-21 13:19:28 -04:00
Colin Walters
2dcd0511c4 dash: Make recent docs display two columns
The design has smaller icons in two columns.  Add a new
custom display to docDisplay for it.

Clean up some of the texture cache handling for recent URIs so
it's not size-dependent, since the dash size is now different
from the default GenericDisplay size.
2009-08-20 19:37:50 -04:00
Sander Dijkhuis
756374b2e4 Unmark GdmUser property strings for translation 2009-08-20 18:09:33 +02:00
Colin Walters
a4bf54e465 ShellAppMonitor: create "applications" for unknown windows
Use MetaGroup for a window when looking up applications.  If
we know the application for a TYPE_NORMAL window in the group,
use that.

However, we aren't always going to know the application for a window.  In
that case, create a fake one.

ShellAppInfo has a "transient" flag so we know not to write these
fake apps to the usage file.

Clean up the idle focus handler to better handle the case where
no window is focused, and where we don't want to track the
particular window.

Update track_window to create the fake window.

When a window goes away, we want to delete the usage.

Rewrite shell_app_monitor_get_running_apps to be based
on the window_to_app hash, because that's what has the pointer
to ShellAppInfo*.  Before we were looking up all ids through
ShellAppSystem, but that shouldn't be holding a ref to transients.

Change the well display icon to be centered, since our icons for
window apps aren't 48 pixels.
2009-08-18 23:07:16 -04:00
Colin Walters
d94606587b Add shell_app_system_create_from_window
For various cases such as when we don't know a .desktop file
for a window, it's desirable to "fake" an application from
the contents of a MetaWindow*.
2009-08-18 23:00:47 -04:00
Colin Walters
74ea9f9305 Add shell_texture_cache_bind_pixbuf_property
This utility function is targeted for MetaWindow; we can create
a ClutterTexture which tracks the value of an "icon" property.
2009-08-18 22:58:27 -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
Owen W. Taylor
4245c573df Clean up our .typelib generation rules
- Prepend to the LD_LIBRARY_PATH not append
- Use $(G_IR_COMPILER) instead of g-ir-compiler
- Use $(AM_V_GEN)
2009-08-15 10:17:36 -04:00
Owen W. Taylor
c27b6493d6 autoconf-2.64 compat: Don't use $(builddir)
$(builddir) is not a standard automake variable. With autoconf < 2.64
it ends up getting set in every Makefile.in to '.' (because autoconf
defines it), but that is no longer the case for 2.64.

Since $(builddir) was always '.', just use that instead.
2009-08-15 10:17:35 -04:00
Colin Walters
a418558b73 Add localization
Infrastructure for localization; hook up intltool, create po/
and po/POTFILES.in.  We need to call bindtextdomain/bind_textdomain_codeset.

Switch to gnome-autogen.sh to call intltool.
2009-08-14 09:14:34 -04:00
Dan Winship
b94452ee42 Redo highlight-drawing logic slightly, as suggested by Owen 2009-08-13 13:51:48 -04:00
Dan Winship
51db34d223 Implement distinct 2-window and multi-window highlights 2009-08-13 13:19:24 -04:00
Colin Walters
557f9ceb97 Bug 591590 - Fix some applications not appearing in menu
Use the correct address for the entry, instead of treating the
ShellAppInfo pointer as one.
2009-08-13 13:02:29 -04:00
Colin Walters
51723bb93b Bug 591626 - Fix crash in ShellAppMonitor
Pass application into signal as expected.  Be sure to reference
it across the call, since removal from the hash unrefs it.
2009-08-12 19:45:17 -04:00
Dan Winship
4b47803162 Implement the multi-window highlight on WellDisplayItem 2009-08-12 17:08:19 -04:00
Dan Winship
15a3f39f65 Add finer-grained signals to ShellAppMonitor, update appDisplay 2009-08-12 17:08:19 -04:00
Colin Walters
25a5da074c ShellTextureCache: Don't try to scale pixbuf to 0 size
If we pass in -1 for both width and height, we'd attempt
to scale the image to 0x0.  Don't do that; just avoid
scaling the pixbuf and let ClutterTexture do it for us.
2009-08-12 15:56:43 -04:00
Colin Walters
789e24b59a ShellAppMonitor: Correctly handle transients
If looking up the application for a transient window, try look up
its transient source.  Ignore transients for the purposes of counting
open windows.
2009-08-12 10:10:19 -04:00
Owen W. Taylor
83b1cedb86 Use distinct filenames for all code generation tempories
Because of a history of cut and paste, the different enumeration
and marshal generation generation shell snippets were using the
same temporary file names. This caused problems for parallel
builds.

http://bugzilla.gnome.org/show_bug.cgi?id=591474
2009-08-11 16:05:31 -04:00
Colin Walters
36ee36283a ShellAppMonitor: Add static to definition of sequence_ref 2009-08-11 13:35:08 -04:00
Colin Walters
74eac21870 Add application menu area to panel
This is a start at the "Active Appliction Item" component of the
shell design.  Currently we just show the currently focused
application.  When launching a new application, we show that as well.

The implementation here is not complete; basically when launching
we de-focus the active one, and the application well shows the
most recent startup sequence.

This kind of fails in the case of multiple sequences, and we
also don't correctly de-focus the current window in other
launch paths.
2009-08-11 13:09:41 -04:00