#include "gtkintl.h"
#include "gtkwidget.h"
#include "gtkroot.h"
-#include "gtknative.h"
+#include "gtknativeprivate.h"
struct _GtkFocusOverlay
{
GtkFocusOverlay *self = GTK_FOCUS_OVERLAY (overlay);
GtkWidget *focus;
graphene_rect_t bounds;
+ int nx, ny;
if (!GTK_IS_NATIVE (widget))
return;
if (!gtk_widget_compute_bounds (focus, widget, &bounds))
return;
+ gtk_native_get_surface_transform (GTK_NATIVE (widget), &nx, &ny);
+ bounds.origin.x += nx;
+ bounds.origin.y += ny;
+
gtk_snapshot_append_color (snapshot, &self->color, &bounds);
}
#include "gtkwidgetprivate.h"
#include "gtkeventcontrollermotion.h"
#include "gtkeventcontrollerkey.h"
-#include "gtknative.h"
+#include "gtknativeprivate.h"
#include "gtkwindowprivate.h"
static GtkWidget *
if (widget)
{
double x, y;
+ int nx, ny;
gdk_surface_get_device_position (gtk_native_get_surface (GTK_NATIVE (widget)),
device, &x, &y, NULL);
+ gtk_native_get_surface_transform (GTK_NATIVE (widget), &nx, &ny);
+ x -= nx;
+ y -= ny;
widget = gtk_widget_pick (widget, x, y, GTK_PICK_INSENSITIVE|GTK_PICK_NON_TARGETABLE);
}
#include "gtkcssstyleprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtkcssnumbervalueprivate.h"
+#include "gtknativeprivate.h"
struct _GtkLayoutOverlay
{
GskRenderNode *node,
GtkWidget *widget)
{
+ int nx, ny;
+
+ gtk_native_get_surface_transform (GTK_NATIVE (widget), &nx, &ny);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &(graphene_point_t){ nx, ny });
recurse_child_widgets (widget, snapshot);
+ gtk_snapshot_restore (snapshot);
}
static void