Commit Graph

281 Commits

Author SHA1 Message Date
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
Timm Bäder
571da2a8b3 Inspector: Protect against childless windows 2015-08-26 12:04:44 +02:00
Timm Bäder
30d56933d4 Inspector: Make monitor rows unactivatable 2015-08-25 18:11:46 +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
df50858dfd inspector: Show monitor information
This is useful to verify the monitor information returned by
other backends.
2015-07-28 01:14:49 -04:00
Matthias Clasen
bc68600cb0 inspector: Show wayland display information
Don't call it "X display" when we show useful information under
Wayland as well.
2015-07-28 00:46:34 -04:00
Matthias Clasen
5c2759af3c Use standard cursor names
This changes GTK+ to use gdk_cursor_new_from_name() with the
'standard' css names, instead of GdkCursorType.

https://bugzilla.gnome.org/show_bug.cgi?id=652085
2015-07-26 01:45:06 -04:00
Matthias Clasen
9a44f18940 inspector: Add a function to rescan
Currently, we only ever scanned the toplevel list and
widget tree once. That is not enough.
2015-07-23 21:27:37 -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
2eb39a3b7a inspector: Remove some dead code
Not sure what I was thinking here. Coverity pointed this out.
2015-07-17 18:47:39 -04:00
Matthias Clasen
ff86433ea1 inspector: Avoid a NULL deref 2015-07-17 18:42:24 -04:00
Matthias Clasen
1b8d06da2d inspector: Check a return value
We don't care about the error here, but we were relying on
g_resources_get_info to zero the size even in case of error.
No need to do that, we can just check the return value. Plus,
it makes coverity happy.
2015-07-17 16:11:16 -04:00
Matthias Clasen
f960d4f486 inspector: Annotate a call whose return value we don't need
The way this code is written, we know that there is an item in
the hash table and the iter_next call will give it to us, so
no need to check the return value. Annotate the call to tell
coverity.
2015-07-17 16:11:16 -04:00
Matthias Clasen
02577ddb06 inspector: Avoid a gratitious use of g_strv_length
No need to count the strings first before iterating over them.
2015-07-16 23:42:55 -04:00
Emmanuele Bassi
e259b2f30d Avoid O(n²) walking of string arrays
"Yo, we heard you like traversing NULL-terminated arrays to operate on
them, so we called g_strv_length() as the for condition, so you can
iterate the array while iterating the array."

Instead of making famed rapper and television producer Xzibit proud, we
should avoid calling g_strv_length() on an array while looping on the
array, to avoid quadratic complexity.

We do this in various places that deal with arrays of strings that we
cannot really guess are short enough not to matter — e.g. the list of
CSS selectors in the inspector, or the required authentication
information for printing.
2015-07-16 16:19:55 +01:00
Christian Hergert
fa6f956489 inspector: allow object read-only properties in prop-editor
If we have a GObject property that is also a GObject, we should be able
to view additional information on that object (even if the param spec
is read-only).
2015-05-05 22:00:54 -07:00
Timm Bäder
b08a1702d1 inspector/misc-info: Fix typo 2015-05-02 17:27:29 +02:00
Chun-wei Fan
efd3758f6a gtk/inspector/css-node-tree.c: Fix Build
strcasecmp() is unfortunately not universally available, along with
strings.h.  Fix the build by replacing strcasecmp() with
g_ascii_strcasecmp(), and remove the strings.h include.

https://bugzilla.gnome.org/show_bug.cgi?id=747604
2015-04-10 17:18:07 +08:00
Ignacio Casal Quinteiro
7719784733 inspector: fix warning about not using the right format for an int64 2015-03-24 13:36:36 +01:00
Vadim Rutkovsky
3211e82b59 inspector: show accessible name and description 2015-03-19 17:01:23 +01:00
Bastien Nocera
7dac38f841 inspector: Make it easier to cut'n'paste advice message
The message says "Enable statistics with GOBJECT_DEBUG=instance-count"
but the message itself isn't selectable, making it hard to cut'n'paste.

https://bugzilla.gnome.org/show_bug.cgi?id=746391
2015-03-18 22:05:46 -04:00
Benjamin Otte
d55c261079 inspector: Add a new page that lists the CSS node tree 2015-03-18 15:23:33 +01:00
Carlos Garnacho
70e7b4c848 inspector: Remove flash timeout from widgets being unmapped
Otherwise the timeout can keep running, even if the widget is being
destroyed.
2015-03-16 16:29:37 +01:00
Matthias Clasen
073a9c9cd5 inspector: Add some margin to css editor
Requested in
https://bugzilla.gnome.org/show_bug.cgi?id=745918
2015-03-10 14:07:27 -04:00
Carlos Garnacho
85ad434290 inspector: Destroy popovers on unmap
As an implementation detail, the popover hooks the fade out animation
on ::hide. Destroying the popover right away here is not a problem, but
prevents the animation from actually running. ::unmap will be run after
the animation is finished, so destroy the popover there.
2015-02-20 14:44:17 +01:00
Lars Uebernickel
f3110e4103 Rename GtkSidebar to GtkStackSidebar
GtkSidebar is too generic and doesn't fully convey what the widget does.

https://bugzilla.gnome.org/show_bug.cgi?id=744094
2015-02-13 18:01:56 +01: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
Timm Bäder
ad180c4335 inspector: Make gl extension rows unactivatable 2015-01-22 21:18:25 +01:00
Benjamin Otte
ebb64c2288 inspector: Remove unused hash table 2015-01-20 06:30:19 +01:00
Benjamin Otte
7ba7dff69e inspector: Remove unused treemodel properties
As a side effect, we can use _gtk_css_section_to_string() to format the
section and save a lot of code.
2015-01-20 06:30:19 +01:00
Benjamin Otte
4ba710ea30 inspector: Use GtkCssStyle and gtk_css_value_to_string() 2015-01-20 06:30:19 +01:00
Benjamin Otte
ad8d30ad86 inspector: Remove a bunch of unused variables 2015-01-17 02:37:36 +01:00
Matthias Clasen
6384167054 inspector: Don't use GSettings directly
It is not necessary here, and using GtkSettings gives us
a greater chance to not fail e.g. on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=742664
2015-01-09 15:29:34 -05:00
Matthias Clasen
c2ff89bbe3 inspector: be careful about gsize vs guint64
Since gsize doesn't work as a typename in a ui file,
we have to be careful not to pass pointers to wrongly
sized variables when getting the guint64 values out
of the model.

https://bugzilla.gnome.org/show_bug.cgi?id=742664
2015-01-09 14:44:26 -05:00
Matthias Clasen
80969e34bc inspector: Show object address
This is useful information when running the application
in a debugger.
https://bugzilla.gnome.org/show_bug.cgi?id=742518
2015-01-09 00:07:01 -05:00
Jasper St. Pierre
915e4c6dd7 inspector: Update translations .ui.h file 2014-12-28 18:13:34 -08:00
Matthias Clasen
b4375cde48 Inspector: Show some X display characteristics
This helps diagnose e.g. csd problems.
2014-12-28 11:36:10 -05:00
Matthias Clasen
20f1c06eed Restore a missing file
No wonder nobody has tried my awesome magnifier yet...
2014-12-28 11:14:39 -05:00
Matthias Clasen
1e1c5c65d1 inspector: Remove an errant shadow 2014-12-20 19:39:09 -05:00
Matthias Clasen
2b07b6c069 inspector: Add a magnifier
Add a magnifier that shows the selected widget up to 5 times
enlarged.
2014-12-20 19:24:08 -05:00
Matthias Clasen
c118e51d52 inspector: Fix capitalization 2014-12-12 23:47:26 -05:00
Matthias Clasen
31ccc372f0 inspector: Add a cursor theme control 2014-12-12 23:46:28 -05:00
Jasper St. Pierre
b6acc8f2c5 actions: Fix compile warning 2014-12-12 17:39:46 -08:00
Christian Hergert
661da5558c widget: add helpers to resolve GActionGroups available to GtkWidget
These functions, while added for use by the GTK inspector, are generally
useful to applications that need to resolve what action groups are
available to a particular GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=741386
2014-12-11 15:25:41 -08:00
Matthias Clasen
23c5f11391 inspector: Make header buttons as !focus-on-click
Moving the focus to the header bar is unexpected and disruptive,
so don't do it.
2014-12-10 22:47:16 -05:00
Matthias Clasen
c5b7f9f11c inspector: Make sure something is focusable on the stats page
Without this, the focus will not be inside the top_stack when
we switch to the statistics page and it shows the excuse. This
in turn will make the next page not take focus as expected when
switching away from the statistics page again.
2014-12-10 22:41:45 -05:00
Matthias Clasen
18799d22cf inspector: Fix focus in css editor
Give the text view initial focus, so things work as expected
when switching to the css editor for the first time.
2014-12-10 22:39:50 -05:00
Matthias Clasen
cf4afd0e93 inspector: Don't force-switch to the objects tab
We used to switch to the objects tab when an object is
picked, but now may have two places with picker buttons:
the objects tab and the interactive tab.

So, just don't do that anymore.
2014-12-09 20:57:58 -05:00