summaryrefslogtreecommitdiff
path: root/gtk/gtkstack.c
Commit message (Collapse)AuthorAgeFilesLines
...
* widget: Remove gtk_widget_get_allocated_size()Benjamin Otte2019-02-191-5/+2
| | | | | Use gtk_widget_get_allocated_width/height in the only user (GtkStack), even though that isn't 100% correct.
* stack: Fix a crashMatthias Clasen2019-02-141-0/+4
| | | | | | | | | | | | | | | | We need to remove the weak pointer, as the stack switcher can keep the list model alive beyond the stack. This was observed to cause crashes: ==16870== Invalid write of size 8 ==16870== at 0x5168A4E: g_nullify_pointer (gutils.c:2284) ==16870== by 0x522C500: weak_refs_notify (gobject.c:2791) ==16870== by 0x50FE7BC: g_data_set_internal (gdataset.c:407) ==16870== by 0x50FECA7: g_datalist_id_set_data_full (gdataset.c:670) ==16870== by 0x5227EB4: g_object_real_dispose (gobject.c:1056) ==16870== by 0x522D295: g_object_unref (gobject.c:3309) ==16870== by 0x4AF849F: unset_stack (gtkstackswitcher.c:428) ==16870== by 0x4AF892E: gtk_stack_switcher_dispose (gtkstackswitcher.c:527)
* stack: Add a pages propertyMatthias Clasen2019-02-131-0/+8
| | | | This makes the list model available in the inspector.
* stack: Don't emit bad ::selection-changed signalsMatthias Clasen2019-02-131-5/+14
| | | | | | We have to be careful to not pass bad numbers to this signal, which was happening in cases where we have on old or new selected item.
* stack: Fix a corner-caseMatthias Clasen2019-02-131-3/+0
| | | | | | When the stack goes empty, we were failing to reset the visible_child member to NULL, causing problems later on, since we don't have a ref for it.
* stack: Don't leak a referenceMatthias Clasen2019-02-131-1/+1
| | | | | The page holds a reference to the widget, so can't just clear this pointer.
* stack: Avoid some ugly unrefsMatthias Clasen2019-02-131-4/+2
| | | | | Instead of using the list model api that forces us to drop the ref, just work with the list we have.
* stack: Drop the position propertyMatthias Clasen2019-02-101-85/+0
| | | | | | GtkStackSwitcher and GtkStackSidebar no longer use the GtkStackPage::position property, so we don't need to maintain it anymore.
* stack: Provide a selection modelMatthias Clasen2019-02-101-6/+234
| | | | | | Make GtkStack expose a selection model for its pages. The model can be used to track changes to the pages, and to change what child is visible.
* stack: Add a GtkStackPage::visible propertyMatthias Clasen2019-02-101-0/+24
| | | | | This will let GtkStackSwitcher track visibility without having to interact with the widgets directly.
* stack: Fix up property notificationMatthias Clasen2019-02-081-4/+7
| | | | This was showing up in testsuite failures.
* stack: Make the child meta work without stackMatthias Clasen2019-02-081-3/+9
| | | | We have tests that expect this to work, like defaultvalue.
* stack: Convert child properties to a child meta objectMatthias Clasen2019-02-081-246/+387
| | | | | | | Create a GtkStackPage public object which holds the former child properties of GtkStack. Adjust all callers.
* stack: Don't queue an unnecessary redrawTimm Bäder2019-01-031-2/+2
| | | | Both queue_allocate and queue_resize already queue a draw.
* widget: Don't pass a position to ->size_allocateTimm Bäder2018-11-131-17/+19
| | | | | The values have been 0/0 for a long time now, so just drop the GtkAllocation argument and replace it with width and height.
* gtkstack: fix null pointer dereferenceHugo Lefeuvre2018-09-271-5/+8
| | | | | | | | | The gtk_stack_snapshot_slide() function dereferences the last_visible_child pointer without proper != NULL ckeck. This might result in NULL pointer dereference and crash if last_visible_child is invalid. Add a != NULL check before dereferencing the pointer.
* Remove a lot of Since annotationsMatthias Clasen2018-06-251-1/+1
| | | | | 4.0 will represent a clean epoch. We don't want to have lots of noise in the docs about 2.x or 3.x.
* snapshot: Redo debug messagesBenjamin Otte2018-04-241-8/+4
| | | | | Instead of every snapshot function having debug messages, have an explicit gtk_snapshot_push_debug() function that appends a debug node.
* stack: protect set_visible_child_name from NULL stackMarco Trevisan (Treviño)2018-04-191-0/+2
| | | | | | | Return with error if gtk_stack_set_visible_child_name is called with NULL parameter (cherry picked from commit 2ee5aee4a9f01cce3dda7dff877070b62c3e2880)
* widget: Remove clip from size-allocate vfuncBenjamin Otte2018-04-051-9/+4
| | | | As the clip is no longer needed, get rid of it.
* snapshot: Remove clip argument from gtk_snapshot_new()Benjamin Otte2018-04-051-1/+0
| | | | | It's not used anymore. And anybody who wants to have a clip on a newly created snapshot can achieve that using gtk_snapshot_push_clip().
* snapshot: Make gtk_snapshot_append_node() take care of offsetBenjamin Otte2018-03-261-21/+10
| | | | Push an offset node when append_node is called. That resets the offset.
* snapshot: Remove rendererBenjamin Otte2018-03-241-2/+1
| | | | | Now that there's no longer a need to keep the renderer around for Cairo rendering, don't do that then.
* GtkWidget: Start renaming widget->windowAlexander Larsson2018-03-201-1/+1
| | | | | | | | | | | | | | | This is an automated change doing these command: git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface git sed -f g gtk_widget_set_window gtk_widget_set_surface git sed -f g gtk_widget_get_window gtk_widget_get_surface git sed -f g gtk_widget_register_window gtk_widget_register_surface git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface git checkout NEWS*
* Use GtkSnapshot gettersMatthias Clasen2018-03-111-2/+2
| | | | | We can avoid direct struct access and gtksnapshotprivate.h everywhere.
* Stop using stack-allocated snapshotsMatthias Clasen2018-03-111-8/+7
| | | | | Use the new/free api instead of init/finish for GtkSnapshot.
* The big versioning cleanupMatthias Clasen2018-02-061-62/+12
| | | | | | | Remove all the old 2.x and 3.x version annotations. GTK+ 4 is a new start, and from the perspective of a GTK+ 4 developer all these APIs have been around since the beginning.
* Remove all gtk_widget_get_content_size usagesTimm Bäder2017-12-061-12/+10
| | | | | And remove the function itself. Make everything use gtk_widget_get_width and gtk_widget_get_height instead.
* gtk: Intern css namesMatthias Clasen2017-11-171-1/+1
| | | | This avoids a bunch of strdups at startup.
* build: Enable -Wswitch-enum and -Wswitch-defaultBenjamin Otte2017-10-061-7/+45
| | | | | | | | | | | | | | | | | | | This patch makes that work using 1 of 2 options: 1. Add all missing enums to the switch statement or 2. Cast the switch argument to a uint to avoid having to do that (mostly for GdkEventType). I even found a bug while doing that: clearing a GtkImage with a surface did not notify thae surface property. The reason for enabling this flag even though it is tedious at times is that it is very useful when adding values to an enum, because it makes GTK immediately warn about all the switch statements where this enum is relevant. And I expect changes to enums to be frequent during the GTK4 development cycle.
* Stack: Fix copy-paste errorDaniel Boles2017-08-011-1/+1
| | | | This fixes Coverity CID 1452217.
* widget: Add baseline and out_clip parameters to size-allocateTimm Bäder2017-07-191-14/+12
| | | | | | | | | | | 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.
* stack: Fix under transitionsTimm Bäder2017-07-191-0/+3
| | | | make sure we initialize both width and height with proper values.
* Fix a few allocation coordinates & sizesTimm Bäder2017-07-191-23/+24
|
* stack: Compute clip directlyTimm Bäder2017-07-191-2/+6
|
* Replace a few get_content_allocation calls with get_content_sizeTimm Bäder2017-07-191-8/+8
| | | | | The position of the content allocation is almost never relevant since it's 0/0 for measure, size_allocate and snapshot.
* stack: Remove bin_windowTimm Bäder2017-07-191-117/+20
|
* stack: Remove gadgetTimm Bäder2017-07-191-62/+11
|
* Slightly rework clip handlingTimm Bäder2017-07-191-3/+1
| | | | | | | | | | | always initialize clips to the (content) allocation, don't walk up the widget hierarchy in gtk_widget_set_clip, implement gtk_widget_size_allocate in GtkSeparator. This way we don't end up using uninitialized clip values. The entire clip handling is up for major rework since we can't and don't want to force every single widget to call _set_clip in size-allocate implementations.
* stack: Remove css box drawingTimm Bäder2017-07-191-19/+1
|
* gtkstack: Remove view windowCarlos Garnacho2017-05-251-24/+7
| | | | | This widget already sets a clip area, so the view window can be safely removed.
* gtk: Mass delete all GtkWidget event mask APICarlos Garnacho2017-05-251-12/+3
| | | | | | | | | | 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.
* container: Remove include_internals parameter from forallTimm Bäder2017-04-251-2/+0
| | | | | | with include_internals=TRUE, this is the same as the (still private) gtk_widget_forall, or just using the children/sibling accessors in a loop.
* stack: Fix node position during crossfadeTimm Bäder2017-01-301-3/+8
|
* snapshot: Redo pop() APIBenjamin Otte2017-01-131-7/+7
| | | | | | | | gtk_snapshot_pop() => removed gtk_snapshot_pop_and_append() => gtk_snapshot_pop() So now there is no way to get a rendernode out of the snapshotting API until you gtk_snapshot_finish().
* stack: Build stored render node with custom Snapshot objectBenjamin Otte2017-01-131-3/+9
| | | | This is in preparation for API changes in GtkSnapshot.
* Add gtk_snapshot_push_cross_fade()Benjamin Otte2017-01-131-26/+7
| | | | | | | | ... and use it. The function is a bit awkward because it requires 2 calls to gtk_snapshot_pop(), but once you accept that, it's very convenient to use, as can be seen by the 2 implementations.
* Avoid some more type checks for internal callsAlexander Larsson2017-01-111-1/+1
|
* Snapshot: Only record names if inspector is recordingAlexander Larsson2017-01-111-3/+7
| | | | | Otherwise we do a lot of allocations and vprintf calls which are not used.
* Remove gtk_container_snapshot_childTimm Bäder2017-01-071-12/+12
| | | | Replace it with the already existing gtk_widget_snapshot_child.