Bug 1190316 - Apply fullscreen transition on only the target monitor. r=roc, a=sledru
authorXidorn Quan <quanxunzhen@gmail.com>
Thu, 13 Aug 2015 08:53:53 +1000
changeset 288765 15d22701fdae4f11d1f337ea5fa50f050a6ea658
parent 288764 de6275eaa3add2a18de6a3ad532d30efef733239
child 288766 a40a4eae93ea5d962bf4a744aa33e6644c388f2a
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, sledru
bugs1190316
milestone42.0a2
Bug 1190316 - Apply fullscreen transition on only the target monitor. r=roc, a=sledru
widget/gtk/mozgtk/mozgtk.c
widget/gtk/nsWindow.cpp
--- a/widget/gtk/mozgtk/mozgtk.c
+++ b/widget/gtk/mozgtk/mozgtk.c
@@ -51,16 +51,18 @@ STUB(gdk_pango_context_get)
 STUB(gdk_pointer_grab)
 STUB(gdk_pointer_ungrab)
 STUB(gdk_property_get)
 STUB(gdk_screen_get_default)
 STUB(gdk_screen_get_display)
 STUB(gdk_screen_get_font_options)
 STUB(gdk_screen_get_height)
 STUB(gdk_screen_get_height_mm)
+STUB(gdk_screen_get_monitor_at_window)
+STUB(gdk_screen_get_monitor_geometry)
 STUB(gdk_screen_get_number)
 STUB(gdk_screen_get_resolution)
 STUB(gdk_screen_get_rgba_visual)
 STUB(gdk_screen_get_root_window)
 STUB(gdk_screen_get_system_visual)
 STUB(gdk_screen_get_width)
 STUB(gdk_screen_height)
 STUB(gdk_screen_is_composited)
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -4630,22 +4630,24 @@ FullscreenTransitionWindow::FullscreenTr
 {
     mWindow = gtk_window_new(GTK_WINDOW_POPUP);
     GtkWindow* gtkWin = GTK_WINDOW(mWindow);
 
     gtk_window_set_type_hint(gtkWin, GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
     gtk_window_set_transient_for(gtkWin, GTK_WINDOW(aWidget));
     gtk_window_set_decorated(gtkWin, false);
 
+    GdkWindow* gdkWin = gtk_widget_get_window(aWidget);
     GdkScreen* screen = gtk_widget_get_screen(aWidget);
-    gint width = gdk_screen_get_width(screen);
-    gint height = gdk_screen_get_height(screen);
+    gint monitorNum = gdk_screen_get_monitor_at_window(screen, gdkWin);
+    GdkRectangle monitorRect;
+    gdk_screen_get_monitor_geometry(screen, monitorNum, &monitorRect);
     gtk_window_set_screen(gtkWin, screen);
-    gtk_window_move(gtkWin, 0, 0);
-    gtk_window_resize(gtkWin, width, height);
+    gtk_window_move(gtkWin, monitorRect.x, monitorRect.y);
+    gtk_window_resize(gtkWin, monitorRect.width, monitorRect.height);
 
     GdkColor bgColor;
     bgColor.red = bgColor.green = bgColor.blue = 0;
     gtk_widget_modify_bg(mWindow, GTK_STATE_NORMAL, &bgColor);
 
     gtk_window_set_opacity(gtkWin, 0.0);
     gtk_widget_show(mWindow);
 }