OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 // I tested every Linux browser I could that worked with our plugin and not | 918 // I tested every Linux browser I could that worked with our plugin and not |
919 // a single one lacked XEmbed/Gtk2 support, so I don't think that case is | 919 // a single one lacked XEmbed/Gtk2 support, so I don't think that case is |
920 // worth implementing. | 920 // worth implementing. |
921 DLOG(ERROR) << "Fullscreen not supported without XEmbed/Gtk2; please use a " | 921 DLOG(ERROR) << "Fullscreen not supported without XEmbed/Gtk2; please use a " |
922 "modern web browser"; | 922 "modern web browser"; |
923 return false; | 923 return false; |
924 } | 924 } |
925 GtkWidget *widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); | 925 GtkWidget *widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
926 // The returned object counts as both a widget and a window. | 926 // The returned object counts as both a widget and a window. |
927 GtkWindow *window = GTK_WINDOW(widget); | 927 GtkWindow *window = GTK_WINDOW(widget); |
| 928 // Ensure that the fullscreen window is displayed on the same screen as the |
| 929 // embedded window. |
| 930 GdkScreen *screen = gtk_window_get_screen(GTK_WINDOW(gtk_container_)); |
| 931 gtk_window_set_screen(window, screen); |
928 // The window title shouldn't normally be visible, but the user will see it | 932 // The window title shouldn't normally be visible, but the user will see it |
929 // if they Alt+Tab to another app. | 933 // if they Alt+Tab to another app. |
930 gtk_window_set_title(window, "O3D Application"); | 934 gtk_window_set_title(window, "O3D Application"); |
931 // Suppresses the title bar, resize controls, etc. | 935 // Suppresses the title bar, resize controls, etc. |
932 gtk_window_set_decorated(window, FALSE); | 936 gtk_window_set_decorated(window, FALSE); |
933 // Stops Gtk from writing an off-screen buffer to the display, which conflicts | 937 // Stops Gtk from writing an off-screen buffer to the display, which conflicts |
934 // with our GL rendering. | 938 // with our GL rendering. |
935 gtk_widget_set_double_buffered(widget, FALSE); | 939 gtk_widget_set_double_buffered(widget, FALSE); |
936 gtk_window_set_keep_above(window, TRUE); | 940 gtk_window_set_keep_above(window, TRUE); |
937 GdkScreen *screen = gtk_window_get_screen(window); | |
938 // In the case of Xinerama or TwinView, these will be the dimensions of the | 941 // In the case of Xinerama or TwinView, these will be the dimensions of the |
939 // whole desktop, which is wrong, but the window manager is smart enough to | 942 // whole desktop, which is wrong, but the window manager is smart enough to |
940 // restrict our size to that of the main screen. | 943 // restrict our size to that of the main screen. |
941 gint width = gdk_screen_get_width(screen); | 944 gint width = gdk_screen_get_width(screen); |
942 gint height = gdk_screen_get_height(screen); | 945 gint height = gdk_screen_get_height(screen); |
943 gtk_window_set_default_size(window, width, height); | 946 gtk_window_set_default_size(window, width, height); |
944 // This is probably superfluous since we have already set an appropriate | 947 // This is probably superfluous since we have already set an appropriate |
945 // size, but let's do it anyway. It could still be relevant for some window | 948 // size, but let's do it anyway. It could still be relevant for some window |
946 // managers. | 949 // managers. |
947 gtk_window_fullscreen(window); | 950 gtk_window_fullscreen(window); |
(...skipping 25 matching lines...) Expand all Loading... |
973 client()->SendResizeEvent(renderer()->width(), renderer()->height(), | 976 client()->SendResizeEvent(renderer()->width(), renderer()->height(), |
974 false); | 977 false); |
975 SetGtkEventSource(gtk_container_); | 978 SetGtkEventSource(gtk_container_); |
976 gtk_widget_destroy(gtk_fullscreen_container_); | 979 gtk_widget_destroy(gtk_fullscreen_container_); |
977 gtk_fullscreen_container_ = NULL; | 980 gtk_fullscreen_container_ = NULL; |
978 fullscreen_window_ = 0; | 981 fullscreen_window_ = 0; |
979 fullscreen_ = false; | 982 fullscreen_ = false; |
980 } | 983 } |
981 } // namespace _o3d | 984 } // namespace _o3d |
982 } // namespace glue | 985 } // namespace glue |
OLD | NEW |