Commit Graph

47 Commits

Author SHA1 Message Date
Matthias Clasen
47249431e3 inspector: Stop using ::hierarchy-changed
Use the new root and unroot vfuncs instead.
2019-02-23 09:43:57 -05:00
Matthias Clasen
b8c981fb2b inspector: Work with new search entry
Don't assume a search entry is an entry, and
use the editable api as far as possible.
2019-02-19 00:25:59 -05:00
Matthias Clasen
fbe0db4007 inspector: Add an api to activate an object
This will be used to make object property inspection
work again.

This will be used to make object property inspection
work againn
2019-02-13 13:40:40 -05:00
Benjamin Otte
be2609a271 inspector: Handle case where there's no default application 2018-09-19 04:31:29 +02:00
Benjamin Otte
2c84049769 treelistmodel: Improve naming a bit
The complexity with model items vs row items is really confusing. Add to
that treelistmodel position vs child model position vs parent position,
and you're so confused, even the best naming can't help.

And once you're there, consider passthrough vs non-passthrough...
2018-09-18 08:03:03 +02:00
Benjamin Otte
05e752e096 inspector: Turn object tree into a GtkListBox
The code gets rid of the GtkTreeView and replaces it with a GtkListBox.

Most of the logic is now done via GListModel subclasses.

A big change is that this new list is now tracking updates itself and
doesn't need to be manually updated. All code that used to cause rescans
or add forgotten objects to the tree has been removed.

If objects are missing from the object tree, the logic for tracking them
needs to be added.
2018-09-16 18:50:17 +02:00
Timm Bäder
0aad5da1b3 widget: Remove controller sequence-state-changed signal connection
We can avoid a signal connection per event controller (and the
EventControllerData struct) since every event controller knows the
widget it's attached to.
2018-05-19 10:18:50 +02:00
Timm Bäder
f6a79559e9 inspector: Don't add controllers to non-window toplevels
That doesn't make sense in this context and breaks grabs.
2018-05-05 09:06:22 +02:00
Timm Bäder
64849426ae inspector: Use unique names for g_object_set_data calls
Otherwise the calls of the different inspector pages might end up
clashing.
2018-05-05 09:05:02 +02:00
Carlos Garnacho
15e00759c7 eventcontrollerkey: Port to new API model 2018-04-26 17:59:42 +02:00
Carlos Garnacho
0b3b81a8bf inspector: Use search bar API to capture key events from the toplevel 2018-04-05 19:26:54 +02:00
Matthias Clasen
c2bd7fcf35 inspector: Stop using ::key-press-event 2018-04-05 19:26:53 +02:00
Timm Bäder
85eef63b32 inspector: Use the attach widget as menu parent object
Fixes #101
2018-03-20 09:37:59 +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
Timm Bäder
8f3cb2658a inspector: Stop adding event controllers to the object tree
There's a dedicated "Gesture" page for all the gestures.
2018-01-08 19:23:06 +01:00
Benjamin Otte
648d040395 widget: Remove gtk_widget_get_screen()
Replace the remaining users with "correct" code that does not need that
function anymore.
2017-10-31 08:25:37 +01:00
Carlos Garnacho
261fdad7ca inspector: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Timm Bäder
42f1ff0123 inspector: Show child widgets of widgets 2017-01-07 17:19:29 +01:00
Emmanuele Bassi
24d59f6c34 inspector: Mark internal function as static 2016-10-17 11:10:14 +01:00
Matthias Clasen
5e68c4e62d inspector: Reset the treewalk when required
The tree walk holds a tree iter, which will become invalid
when we either remove the row that it points to or remove
all rows.

Reset the tree walk in those cases to avoid a crash that
was pointed out by Bastien Nocera.
2016-03-11 13:53:57 -05:00
Matthias Clasen
dc5c82e29c inspector: Don't select 'randomly'
While rescanning the object tree, we were emitting ::object-selected
signals, possibly causing wild blinking in the application window.
Don't do that.

https://bugzilla.gnome.org/show_bug.cgi?id=760572
2016-01-13 23:24:38 -05:00
Matthias Clasen
80a91722e5 inspector: Don't leak weak references
These come back to bite us when the inspector is no longer around
at the end of the program.

https://bugzilla.gnome.org/show_bug.cgi?id=759768
2015-12-26 21:42:10 -05:00
Matthias Clasen
787f600d33 inspector: Remove some dead code
Since commit bffeae6203, the
tree path is not used for anything useful anymore, so do away
with it entirely.
2015-12-26 21:42:10 -05:00
Matthias Clasen
6f1c945010 inspector: Avoid a crash
gkt_cell_layout_get_area may return NULL, handle it.
2015-12-06 17:25:31 -05:00
Matthias Clasen
774b6f94d5 inspector: fix a typo 2015-11-10 17:36:23 -05:00
Matthias Clasen
f55e3f7eda inspector: Be more careful with dead objects
gtk_inspector_object_tree_find_object accesses the type information
of the object, so we can't safely use it on an already decaying
object when we get a weak notify. Instead just walk the tree and
compare pointers, that is safe.

https://bugzilla.gnome.org/show_bug.cgi?id=756852
2015-10-25 13:11:17 -04:00
Benjamin Otte
bcc0a54383 inspector: Store the parent for the object tree
This allows selecting newly added random objects.

https://bugzilla.gnome.org/show_bug.cgi?id=754987
2015-09-14 23:36:37 +02:00
Benjamin Otte
bffeae6203 inspector: Handle object destruction without row references
This way, we can live without row references.

A side effect is that opening the inspector on the gtk-demo list box
example now only takes 0.5s instead of the previous 3 minutes.
2015-08-26 16:33:52 +02:00
Benjamin Otte
1f2bd47965 inspector: Implement find_object() without GtkTreeRowReference
Tree row references are slow to update. And we update the widget list
quite a bit, so when it grows it can get REALLY slow.
2015-08-26 15:46:07 +02:00
Benjamin Otte
c7ed2c2130 inspector: Refactor object tree construction
Instead of having lots of if statements, create a vtable. This will be
useful for the following patches.
2015-08-26 15:46:07 +02:00
Matthias Clasen
56d39241a9 inspector: Fix a typo
Blocking a signal should be paired with unblocking.
Spotted by Krzesimir Nowak
2015-08-04 07:11:34 -04:00
Matthias Clasen
142efd186d Inspector: Preserve selection when rescanning
We are semiregularly repopulating the object tree. Whenever
we do, we loose the selection, needlessly. Do the extra work
to preserve it.

http://bugzilla.gnome.org/show_bug.cgi?id=753130
2015-08-02 15:20:17 -04:00
Matthias Clasen
c27b90cc79 Fix the build 2015-07-17 20:45:28 -04:00
Matthias Clasen
d8a40c4587 inspector: Avoid a NULL deref
Coverity pointed out that getting a class name requires
dereferencing the pointer, so only don't do it if it is NULL.
2015-07-17 19:52:52 -04:00
Matthias Clasen
354536d464 inspector: Use some of the new GtkSearchEntry API
Avoid repetitive, manual event handling in various places
in GtkInspector.
2015-01-24 08:44:30 -05:00
Matthias Clasen
383d5b137b inspector: Build nonrecursively 2014-11-30 16:11:56 -05:00
Matthias Clasen
a7ba57f751 inspector: Add menu models to the tree
Add both the appmenu and the menubar models as children of the
application, if they exist.
2014-11-22 21:38:47 -05:00
Matthias Clasen
5b7233f136 inspector: Store object title on object 2014-11-22 21:38:46 -05:00
Matthias Clasen
85a539ce6d inspector: Add frame clock info
Add the frame clocks of toplevel widgets to the object tree,
and show their frame count and frame rate in the misc tab.
2014-11-12 22:52:59 -05:00
Matthias Clasen
3f3725d97b inspector: Refine object tree search
Behave similar to traditional treeview search, and center
the row when moving between matches.
2014-10-31 21:13:18 -04:00
Matthias Clasen
992c5f0dd6 inspector: Add search to the object tree
This is also an attempt to figure out a better story for search
in treeviews.
2014-10-31 21:02:50 -04:00
Matthias Clasen
bd031b89c1 inspector: Add style classes to the object list
We have a lot of space here now, so show some
useful information.
2014-10-25 10:00:39 -04:00
Matthias Clasen
a46d4e51f7 inspector: Improve details buttons
Ensure that the details buttons are only sensitive when
we actually have details to show.
2014-10-24 21:52:23 -04:00
Matthias Clasen
70c3241bd3 inspector: Improve tab switching
Switch the object and resource trees away from activate-on-single-click
and add a 'view details' button.
2014-10-24 21:14:16 -04:00
Matthias Clasen
c16fa45bfe inspector: Use a separate display connection
This helps isolate the inspector from some of the changes that
it can trigger. To specify a different display, set
GTK_INSPECTOR_DISPLAY to the name of the display to use for
the inspector window. If no display is specified, GTK+ will
use a separate connection to the default display.
2014-10-24 15:57:33 -04:00
Matthias Clasen
dffceb1a17 inspector: Avoid a split pane for objects
Like for the resources page, use a separate page for details
to gain more room for both the tree and the details.
2014-10-11 00:59:36 -04:00
Matthias Clasen
a8dc098699 inspector: More refactoring
Rename widget tree to object tree. It contains plenty of
non-widgets nowadays, after all.
2014-10-11 00:59:36 -04:00