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
This commit is contained in:
Adel Gadllah
2011-01-05 15:47:27 +01:00
parent 62507c9759
commit ceedc7e32c
11 changed files with 433 additions and 16 deletions

View File

@ -113,6 +113,8 @@ struct _GnomeShellPlugin
int glx_error_base;
int glx_event_base;
guint have_swap_event : 1;
ShellGlobal *global;
};
struct _GnomeShellPluginClass
@ -320,7 +322,6 @@ gnome_shell_plugin_start (MetaPlugin *plugin)
int status;
const char *shell_js;
char **search_path;
ShellGlobal *global;
const char *glx_extensions;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@ -379,10 +380,10 @@ gnome_shell_plugin_start (MetaPlugin *plugin)
gvc_muted_debug_log_handler, NULL);
/* Initialize the global object here. */
global = shell_global_get ();
shell_plugin->global = shell_global_get ();
_shell_global_set_plugin (global, META_PLUGIN(shell_plugin));
_shell_global_set_gjs_context (global, shell_plugin->gjs_context);
_shell_global_set_plugin (shell_plugin->global, META_PLUGIN(shell_plugin));
_shell_global_set_gjs_context (shell_plugin->global, shell_plugin->gjs_context);
add_statistics (shell_plugin);
@ -511,9 +512,9 @@ static gboolean
gnome_shell_plugin_xevent_filter (MetaPlugin *plugin,
XEvent *xev)
{
#ifdef GLX_INTEL_swap_event
GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin);
GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin);
#ifdef GLX_INTEL_swap_event
if (shell_plugin->have_swap_event &&
xev->type == (shell_plugin->glx_event_base + GLX_BufferSwapComplete))
{
@ -545,6 +546,12 @@ gnome_shell_plugin_xevent_filter (MetaPlugin *plugin,
&& xev->xcrossing.window == clutter_x11_get_stage_window (CLUTTER_STAGE (clutter_stage_get_default ())))
return TRUE;
/*
* Pass the event to shell-global
*/
if (_shell_global_check_xdnd_event (shell_plugin->global, xev))
return TRUE;
return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
}