Commit Graph

53891 Commits

Author SHA1 Message Date
Matthias Clasen
351559fcfa Simplify all ui files again
Now even simpler!
2018-01-18 17:53:44 -05:00
Matthias Clasen
6c805ecb0f builder-tool: Try harder to find types
If g_type_from_name fails, try gtk_builder_get_type_from_name
before giving up. This fixes cases like GtkPrinterOptionWidget.
2018-01-18 17:45:12 -05:00
Timm Bäder
8a432b42a2 window: Ignore gtk_window_close calls from close-request handlers 2018-01-18 15:10:49 +01:00
Timm Bäder
aee4634ee5 widget: Always assign values to out parameter in translate_coordinates
safe guard against people using the returned coordinate values without
checking the return value of gtk_widget_translate_coordinates.
2018-01-18 14:45:13 +01:00
Timm Bäder
cc9a4c1720 widget: Initialize a local variable
We will later pass this variable on to some other functions, so be safe
against them using the value.
2018-01-18 14:45:13 +01:00
Timm Bäder
d607312080 aboutdialog: Only close on delete events
Clicking on the Credits button should not close the dialog.
2018-01-18 14:45:08 +01:00
Timm Bäder
41dac661a0 fontchooswerwidget: Center spinbutton next to scales vertically 2018-01-18 09:40:19 +01:00
Timm Bäder
41a922928e gl renderer: Render GL textures upside down
These come from an FBO so we need to flip the texture coords on the y
axis, just like we do everywhere else.
2018-01-18 08:21:11 +01:00
Matthias Clasen
182272c0ab Revert "inspector: Stop adding event controllers to the object tree"
This reverts commit 8f3cb2658a.

This didn't quite work out, since being in the object tree is
a prerequisite for showing up in the property editor.
2018-01-17 23:49:17 -05:00
Matthias Clasen
e1d81d096c Document new texture api 2018-01-17 21:45:08 -05:00
Matthias Clasen
47b7bfd2ba Use the new api to release resources
When we unrealize a GL area with outstanding textures,
call gdk_texture_release_gl on them to avoid later crashes.
2018-01-17 20:19:19 -05:00
Matthias Clasen
5e302ae2cc Add a way to release GL resources
The inspector may hold on to render nodes and textures
beyond the lifetime of the widget (and thus the GL
resources). To handle this situation, allow the widget
to explicitly release the GL resources, and make
the texture available on the clent-side as a cairo
surface. This lets the recorder still show the content
after the widget is gone.
2018-01-17 20:15:45 -05:00
Matthias Clasen
34c63b8e4f glarea: Drop the dispose vfunc
This was causing us to leak, in the following scenario:
1) gtk_widget_destroy is called on a GL area
2) dispose is run and clears the context
3) the GL area is unrealized, but the context is already cleared,
   so we leak all the GL buffers
2018-01-17 19:49:52 -05:00
Matthias Clasen
0429008b16 glarea: Always delete textures on unrealize
We need to make the context current for deleting
textures as well, so just do it unconditionally.
2018-01-17 19:49:05 -05:00
Matthias Clasen
6ea827cde5 glarea: Avoid a crash
We must only delete the texture if it is not NULL.
2018-01-17 19:48:33 -05:00
Matthias Clasen
cdb2fcb554 gdkgears: add a way to remove gears
This is needed to test the GL resource cleanup
code paths.
2018-01-17 19:47:45 -05:00
Matthias Clasen
4f50bf23d3 glarea: Add a pool for GL textures
Handle the situation that a GL texture might remain
in use (e.g. by a slow frame, or by the recorder)
In that case, we can't modify it but must use a
new one. Keep a pool of GL textures for this eventuality.
2018-01-17 19:15:14 -05:00
Matthias Clasen
18dc994de7 inspector: Don't leak recordings
g_list_model_get_item is transfer full, so we need
to drop the references we get from it. This was showing
up while testing the GL texture cache in GtkGLArea.
2018-01-17 19:12:55 -05:00
Timm Bäder
5e7b3030b9 rendernodeimpl: Fix a crash
We may get a NULL renderer here.
2018-01-17 21:57:20 +01:00
Timm Bäder
7c47c7cdaf applicationwindow: Fix measure implementation
Really calculate the menubar height, not the width.
2018-01-17 21:57:20 +01:00
Timm Bäder
e7b3909fd1 sizerequest: Fix for_size adjustment
We need to pull the proper size from the size request cache and adjust
it accordingly.
2018-01-17 21:57:20 +01:00
Timm Bäder
27c76db956 box: Simplify some code
All out varibles in measure implementations must be non-null and -1 is
the default value for the baseline parameters.
2018-01-17 21:57:20 +01:00
Timm Bäder
e763dac72e box: Remove self assignment 2018-01-17 21:57:19 +01:00
Timm Bäder
8ab2c79b77 box: Remove useless if statement
We already check right before this one whether child->pack != packing
and if so, we continue to the next iteration. So, no need to check again
whether the inverted condition child->pack == packing is true, because
it is.
2018-01-17 21:57:19 +01:00
Timm Bäder
12be5ccbb7 label: Update layout width directly form allocation
For the one update_layout_width call in size_allocate, we can just use
the passed-in allocation width instead of a separate (relatively slow)
gtk_widget_get_width call.
2018-01-17 21:57:19 +01:00
Timm Bäder
8ad1b09a3a widget: Clip redrawn area to widget clip
The clip can already be modified in size_allocate, so we never want a
widget to invalidate more than its actual clip region.
2018-01-17 21:57:19 +01:00
Timm Bäder
c2d4f05ce0 box: Remove some unneeded checks
We only call this function from the measure implementation and we should
never get NULL pointers there.
2018-01-17 21:57:19 +01:00
Timm Bäder
c475047501 box: Remove an unnecessary local variable 2018-01-17 21:57:19 +01:00
Timm Bäder
3604816b9c box: Use GtkWidget's widget list in get_size 2018-01-17 21:57:19 +01:00
Timm Bäder
cb0d2616ff listbox: Don't assume that row child == focus widget
With widgets supporting child widgets and custom GtkListBoxRow
subclasses, this might not be true.
2018-01-17 21:57:19 +01:00
Timm Bäder
229ef9d776 widget: Remove reparent special case
Since gtk_widget_reparent doesn't exist anymore, we can also remove this
special case.
2018-01-17 21:57:19 +01:00
Timm Bäder
d3329bb36b container: Remove some unused includes 2018-01-17 21:57:19 +01:00
Timm Bäder
5590a2a943 viewport: Remove some unused includes 2018-01-17 21:57:19 +01:00
Matthias Clasen
736ccd34f0 gl area: Avoid trivialities
If we have zero pixels, no need to snapshot anything,
and produce GL errors while doing so.
2018-01-17 14:43:50 -05:00
Matthias Clasen
b6d85b9e31 gtk-demo: Add gears to the bowl
Just for fun.
2018-01-17 14:39:46 -05:00
Matthias Clasen
f3927f1155 Drop GtkGLArea::has-alpha
We now always behave as if has-alpha is TRUE.

Update all callers.
2018-01-17 12:01:25 -05:00
Matthias Clasen
5711fb9b26 Convert gtkglarea to use snapshots
Just append a texture node.

Note that this is not 100% done yet. The GL area really
needs to keep a pool of textures, and only reuse them
once the GdkTexture object is gone.
2018-01-17 12:00:13 -05:00
Matthias Clasen
31fcf5b3a7 gsk: Handle GL textures
These textures already have a GL texture in them,
no need to create a new one.
2018-01-17 11:57:25 -05:00
Matthias Clasen
b366ea84a7 gdk: Add a gl texture implementation
This will be used to pass a GL textures from the application
(or rather, GtkGLArea) down to the GSK GL renderer.
2018-01-17 11:56:47 -05:00
Matthias Clasen
e7cab2bc0c Drop removed api from the docs
This should have been part of the previous commit.
2018-01-16 23:33:40 -05:00
Matthias Clasen
77bab4e027 gdk: Drop some unused cursor apis
The query function for cursor sizes and capabilities
are not very interesting. At least, they are not used
in GTK+, and all backends but X11 just hardcode
made-up values anyway. So, lets drop them.
2018-01-16 23:32:01 -05:00
Matthias Clasen
ab1f17cb9a inspector: Stop using gdk_display_get_default_cursor_size
If the cursor theme size setting has no value, just hardcode 32.
Also, allow ridiculously large cursors, just for fun.
2018-01-16 23:25:50 -05:00
Matthias Clasen
35c78a995e tooltip: Stop using gdk_display_get_default_cursor_size
It makes more sense to use the actual cursor theme size here.
2018-01-16 23:25:50 -05:00
Matthias Clasen
3fa0d4dad7 testgtk: Stop using gdk_display_get_maximal_cursor_size
This function is going away. Just make a reasonable assumption
that cursor sizes up to 128 are supported.
2018-01-16 23:25:50 -05:00
Chris Lamb
edd1b0974c gtk/queryimmodules.c: Make the output deterministic.
Whilst working on the Reproducible Builds effort [0], we noticed that
queryimmodules generates non-reproducible output as it iterates over the
filesystem without sorting.

Patch attached.

 [0] https://reproducible-builds.org/

Signed-off-by: Chris Lamb <lamby@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=786528
2018-01-16 22:38:32 -05:00
Matthias Clasen
e2f3b9b1cc tree model sort: Fix set_sort_column
We were failing to change the sort order for the
default sort column in some cases. Fix that, and
add a testcase for this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=792459

Add a testcase for the previous fix
2018-01-16 18:17:54 -05:00
Matthias Clasen
42369e31e2 tree model sort: Fix initial default sort func
gtk_tree_sortable_has_default_sort_func should return
FALSE initially.
2018-01-16 18:15:13 -05:00
Matthias Clasen
33ec75944f Fix the icontheme test
We rely on log messages here. Since logging is per-display
now, we need to set a display on our custom icontheme object
to get the expected log messages.
2018-01-16 15:42:28 -05:00
Matthias Clasen
e8079df420 mountoperation: Fix a crash
We only create the gesture when the dialog is needed,
so don't free it unconditionally.
2018-01-16 14:50:25 -05:00
Matthias Clasen
e0990b2311 Drop ::button-press/release event
We are no longer using these, and there are several gestures
that can be used instead. If you need to catch raw button events,
use the ::event signal.
2018-01-16 14:14:11 -05:00