diff options
author | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-22 23:06:31 +0000 |
---|---|---|
committer | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-22 23:06:31 +0000 |
commit | e5a016dd9d312e5143f5deb865a110aa0b96379b (patch) | |
tree | 3d695c5b67ccca5594807c46be1d7cead3d1d073 /o3d | |
parent | c4c12e9d1a8ee46eacc7252eda9cebc0b0250059 (diff) | |
download | chromium_src-e5a016dd9d312e5143f5deb865a110aa0b96379b.zip chromium_src-e5a016dd9d312e5143f5deb865a110aa0b96379b.tar.gz chromium_src-e5a016dd9d312e5143f5deb865a110aa0b96379b.tar.bz2 |
Linux: make sure the fullscreen window always gets focus
TEST=tested fullscreen on Linux with metacity, metacity + focus-follows-mouse, compiz, compiz + focus-follows-mouse
BUG=none
Review URL: http://codereview.chromium.org/652076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39651 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/plugin/cross/o3d_glue.h | 4 | ||||
-rw-r--r-- | o3d/plugin/linux/main_linux.cc | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/o3d/plugin/cross/o3d_glue.h b/o3d/plugin/cross/o3d_glue.h index 3e7f8a7..7d72fee 100644 --- a/o3d/plugin/cross/o3d_glue.h +++ b/o3d/plugin/cross/o3d_glue.h @@ -356,7 +356,11 @@ class PluginObject: public NPObject { // called by the platform-specific event-handling code if the region set by // SetFullscreenClickRegion is clicked. It requests the mode previously set // by SetFullscreenClickRegion(), and fails if there wasn't one. +#ifdef OS_LINUX + bool RequestFullscreenDisplay(guint32 timestamp); +#else bool RequestFullscreenDisplay(); +#endif // Make a region of the plugin area that will invoke fullscreen mode if // clicked. The app developer is responsible for communicating this to the diff --git a/o3d/plugin/linux/main_linux.cc b/o3d/plugin/linux/main_linux.cc index 3ecf51f..e1ac5ff 100644 --- a/o3d/plugin/linux/main_linux.cc +++ b/o3d/plugin/linux/main_linux.cc @@ -473,7 +473,7 @@ static gboolean GtkHandleMouseButton(GtkWidget *widget, } if (event.in_plugin() && event.type() == Event::TYPE_MOUSEDOWN && obj->HitFullscreenClickRegion(event.x(), event.y())) { - obj->RequestFullscreenDisplay(); + obj->RequestFullscreenDisplay(button_event->time); } return TRUE; } @@ -910,7 +910,7 @@ bool PluginObject::GetDisplayMode(int id, o3d::DisplayMode *mode) { // TODO: Where should this really live? It's platform-specific, but in // PluginObject, which mainly lives in cross/o3d_glue.h+cc. -bool PluginObject::RequestFullscreenDisplay() { +bool PluginObject::RequestFullscreenDisplay(guint32 timestamp) { if (fullscreen_ || fullscreen_pending_) { return false; } @@ -953,7 +953,11 @@ bool PluginObject::RequestFullscreenDisplay() { g_signal_connect(window, "delete-event", G_CALLBACK(GtkDeleteEventCallback), this); gtk_fullscreen_container_ = widget; - gtk_widget_show(widget); + // The timestamp here is optional, but its inclusion is preferred. + gtk_window_present_with_time(window, timestamp); + // Explicitly set focus, otherwise we may not get it depending on the window + // manager's policy for present. + gdk_window_focus(widget->window, timestamp); // We defer switching to the new window until it gets displayed and assigned // it's final dimensions in the configure-event. fullscreen_pending_ = true; |