summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--o3d/plugin/cross/o3d_glue.h4
-rw-r--r--o3d/plugin/linux/main_linux.cc10
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;