Backed out changeset be2cd52df099 (bug 1512416) for build bustage

This commit is contained in:
Dorel Luca 2018-12-19 14:24:31 +02:00
Родитель 1ffb306df3
Коммит d586d50b96
4 изменённых файлов: 5 добавлений и 48 удалений

Просмотреть файл

@ -224,33 +224,6 @@ static gint moz_container_get_scale(MozContainer *container) {
return 1; return 1;
} }
void moz_container_scale_changed(MozContainer *container,
GtkAllocation *aAllocation) {
MOZ_ASSERT(!GDK_IS_X11_DISPLAY(gdk_display_get_default()),
"moz_container_scale_changed operates on Wayland display only.");
if (!container->surface) {
return;
}
// Set correct scaled/unscaled mozcontainer offset
// especially when wl_egl is used but we don't recreate it as Gtk+ does.
gint x, y;
gdk_window_get_position(gtk_widget_get_window(GTK_WIDGET(container)), &x,
&y);
wl_subsurface_set_position(container->subsurface, x, y);
// Try to only resize wl_egl_window on scale factor change.
// It's a bit risky as Gtk+ recreates it at that event.
if (container->eglwindow) {
gint scale = moz_container_get_scale(container);
wl_surface_set_buffer_scale(container->surface,
moz_container_get_scale(container));
wl_egl_window_resize(container->eglwindow, aAllocation->width * scale,
aAllocation->height * scale, 0, 0);
}
}
#endif #endif
void moz_container_map(GtkWidget *widget) { void moz_container_map(GtkWidget *widget) {
@ -538,7 +511,6 @@ struct wl_egl_window *moz_container_get_wl_egl_window(MozContainer *container) {
container->eglwindow = container->eglwindow =
wl_egl_window_create(surface, gdk_window_get_width(window) * scale, wl_egl_window_create(surface, gdk_window_get_width(window) * scale,
gdk_window_get_height(window) * scale); gdk_window_get_height(window) * scale);
wl_surface_set_buffer_scale(surface, scale);
} }
return container->eglwindow; return container->eglwindow;
} }

Просмотреть файл

@ -96,8 +96,6 @@ struct wl_egl_window *moz_container_get_wl_egl_window(MozContainer *container);
gboolean moz_container_has_wl_egl_window(MozContainer *container); gboolean moz_container_has_wl_egl_window(MozContainer *container);
gboolean moz_container_surface_needs_clear(MozContainer *container); gboolean moz_container_surface_needs_clear(MozContainer *container);
void moz_container_scale_changed(MozContainer *container,
GtkAllocation *aAllocation);
#endif #endif
#endif /* __MOZ_CONTAINER_H__ */ #endif /* __MOZ_CONTAINER_H__ */

Просмотреть файл

@ -3190,22 +3190,6 @@ void nsWindow::OnCompositedChanged() {
} }
} }
void nsWindow::OnScaleChanged(GtkAllocation *aAllocation) {
#ifdef MOZ_WAYLAND
if (mContainer && moz_container_has_wl_egl_window(mContainer)) {
// We need to resize wl_egl_window when scale changes.
moz_container_scale_changed(mContainer, aAllocation);
}
#endif
// This eventually propagate new scale to the PuppetWidgets
OnDPIChanged();
// configure_event is already fired before scale-factor signal,
// but size-allocate isn't fired by changing scale
OnSizeAllocate(aAllocation);
}
void nsWindow::DispatchDragEvent(EventMessage aMsg, void nsWindow::DispatchDragEvent(EventMessage aMsg,
const LayoutDeviceIntPoint &aRefPoint, const LayoutDeviceIntPoint &aRefPoint,
guint aTime) { guint aTime) {
@ -5581,10 +5565,14 @@ static void scale_changed_cb(GtkWidget *widget, GParamSpec *aPSpec,
if (!window) { if (!window) {
return; return;
} }
// This eventually propagate new scale to the PuppetWidgets
window->OnDPIChanged();
// configure_event is already fired before scale-factor signal,
// but size-allocate isn't fired by changing scale
GtkAllocation allocation; GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation); gtk_widget_get_allocation(widget, &allocation);
window->OnScaleChanged(&allocation); window->OnSizeAllocate(&allocation);
} }
#if GTK_CHECK_VERSION(3, 4, 0) #if GTK_CHECK_VERSION(3, 4, 0)

Просмотреть файл

@ -258,7 +258,6 @@ class nsWindow final : public nsBaseWidget {
void OnDPIChanged(void); void OnDPIChanged(void);
void OnCheckResize(void); void OnCheckResize(void);
void OnCompositedChanged(void); void OnCompositedChanged(void);
void OnScaleChanged(GtkAllocation* aAllocation);
#ifdef MOZ_X11 #ifdef MOZ_X11
Window mOldFocusWindow; Window mOldFocusWindow;