Commit Graph

11 Commits

Author SHA1 Message Date
Timm Bäder
53ad763042 magnifier: Port to snapshot
Instead of gtk_widget_draw'in the inspected widget inside the
magnifier's ::draw handler, just create a new GtkSnapshot and snapshot
in its snapshot handler, similar to what GtkStack is doing.
2017-08-23 16:33:49 +02:00
Timm Bäder
36ab70ddf5 widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.
2017-07-19 21:27:16 -04:00
Carlos Garnacho
a72404dd5a gtk: Mass delete all GtkWidget event mask API
We now rely on toplevels receiving and forwarding all the events
the windowing should be able to handle. Event masks are no longer a
way to determine whether an event is deliverable ot a widget.

Events will always be delivered in the three captured/target/bubbled
phases, widgets can now just attach GtkEventControllers and let those
handle the events.
2017-05-25 16:25:58 +02:00
Timm Bäder
9992a616ef widget: Use ::measure vfunc to measure size
Add a new ::measure vfunc similar to GtkCssGadget's that widget
implementations have to override instead of the old get_preferred_width,
get_preferred_height, get_preferred_width_for_height,
get_preferred_height_for_width and
get_preferred_height_and_baseline_for_width.
2016-10-22 19:05:47 +02:00
Matthias Clasen
5efb574055 magnifier: Only connect to ::draw when needed
This making us take the slow path in ::draw handling, so we
want to avoid it if we can.

https://bugzilla.gnome.org/show_bug.cgi?id=765238
2016-04-19 15:29:04 -04:00
Rui Matos
019dab7c38 gtkmagnifier: Avoid a crash if the inspected widget is finalized
If the inspected widget is finalized and we then try to disconnect
from its signals we'll crash.

https://bugzilla.gnome.org/show_bug.cgi?id=761775
2016-02-09 15:35:17 +01:00
Alexander Larsson
d5f1754981 gtk: Stop setting GDK_EXPOSURE_MASK on random widgets
These days exposure happens only on the native windows (generally the
toplevel window) and is propagated down recursively. The expose event
is only useful for backwards compat, and in fact, for double buffered
widgets we totally ignore the event (and non-double buffering breaks
on wayland).

So, by not setting the mask we avoid emitting these events and then
later ignoring them.

We still keep it on eventbox, fixed and layout as these are used
in weird ways that want backwards compat.
2015-09-14 11:01:13 +02:00
Matthias Clasen
10d0ca0a3d GtkMagnifier: Add a resizing mode
In addition to the fixed-size mode that is used by the text view,
add a mode in which the magnifier requests enough size to render
the entire inspected widget at the current magnification. In this
mode, the magnifier will update its size when the size of the
inspected widget changes. Also, make the magnifier redraw on its
own whenever the inspected widget draws.
2014-12-20 19:16:46 -05:00
Carlos Garcia Campos
ae36e57c61 gtkmagnifier: do not use P_() macro for property names 2014-02-07 10:01:49 +01:00
Carlos Garnacho
8595a38145 magnifier: Fix compiler warning 2014-01-22 20:50:33 +01:00
Carlos Garnacho
61ab302c75 Add GtkMagnifier
This is a private widget that takes another widget on construction, and is able
to render parts of it, possibly at a different magnification level.
2014-01-22 17:10:05 +01:00