| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
Fixes #371. Gtk.Button.set_focus_on_click and Gtk.Button.get_focus_on_click
are deprecated since version 3.20. This override calls the Gtk.Widget methods
so that users don't get a deprecation message.
Signed-off-by: Dan Yeaw <dan@yeaw.me>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
init_template method is automatically called when a widget is
created and it is not supposed to be called multiple times. That is
why this method is turned into a no-op after its first call via a
lambda function.
init_template can still be called after a widget creation (and it is
supposed to do nothing). However, a second call will result in a crash
because the lambda function has a parameter while init_template is not
supposed to have any parameter.
This issue is fixed by removing the parameter of the lambda function.
A new test is also added to assert that a second init_template call
does nothing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a widget is inside a template it is created through a
g_object_new and does not have a python wrapper when
pygobject__g_instance_init is called. In that case, a wrapper is
created and the "__init__" method is called to instantiate it. Then,
"init_template" is called to init its own template (if it exists).
However, "init_template" needs to be called before the object
constructor in order to create and instantiate all its children,
signals and properties.
This issue is fixed by calling init_template before the contructor if
the python object has been created through g_object_new.
A new test for the template hierarchy is added (based on an example
from Marinus Schraal).
Closes: #257, #386
|
| |
|
|
|
|
| |
This is a leftover from when things were split up
|
|
|
|
| |
Less macro magic
|
|
|
|
| |
Less macro magic
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
TreeModel.sort_new_with_model exist
In https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1134 the method was changed to a constructor
which means the API is different between older and newer gtk.
Add fallbacks for both in our overrides so both ways work all the time.
|
|
|
|
|
|
|
| |
It has been removed (gtk commit
4dd780a96b1d37903ab88a4ae4536329cd9e164e)
The associated tests are updated or skipped for Gtk 4.
|
|
|
|
|
|
|
| |
It has been removed (gtk commit
44e153d8a8679633681dd3ae2029735255e4f839).
The associated test is removed.
|
|
|
|
| |
These API's have been removed (gtk commit 7ee5779efcf5).
|
|
|
|
| |
This issue was introduced in a102f046a178472278522e3e9d7c0b40ecd52ade.
|
|
|
|
|
|
|
|
| |
This makes it easier to track upstream changes without us having to
rebuild docker images.
Downside is that we don't control it and API is still changing,
so allow the job to fail.
|
|
|
|
|
|
|
|
| |
g_object_newv() and GParameter are deprecated now.
Replace all GParameter usage with a separate GValue and char* array
and add a compatibility function for g_object_new_with_properties()
that also works with older glib and converts things back to GParameter.
|
|
|
|
|
| |
This should make things build with -Werror again once we port things
to g_object_new_with_properties()
|
|
|
|
| |
It's not used anywhere else atm
|
|
|
|
|
|
|
|
|
|
|
| |
To make deprecation warnings more visible we made it inherit from RuntimeWarning
with unstable releases and DeprecationWarning for stabel releases.
This is a bit confusing when being flooded with warnings when testing under jhbuild
etc. Also recent pytest has changed to show deprecation warnings triggered during
tests, so the warnings should be more visible now for devs using pytest.
This changes it to inherit from DeprecationWarning always again.
|
|
|
|
|
|
|
|
|
| |
When g_signal_emitv returns a floating reference as the return
value, which we end up ref_sinking, do not unset the GValue,
as we've taken ownership from it and don't want it to drop its
reference.
Adds a test that highlights the issue
|
|
|
|
|
|
|
| |
Consumers of this API will get GParameter notifications elsewhere in their
code when using GParameter. Since it needs to be around for compatibility
API, we can safely ignore it here and save consuming applications some
duplicated deprecation warnings.
|
|
|
|
|
|
| |
This avoids iterating twice: once to create the list with a
list-comprehension and a second time to transform that list into a
tuple.
|
|
|
|
|
|
|
|
| |
This saves a bit of work, instead of defining the dictionary every time
the method is called.
Unpacking many GVariants in a loop, this shaved roughly 17% of the total
time.
|
|
|
|
|
| |
This saves a bit of work. Unpacking many GVariants in a loop, this
shaved roughly 6% of the total time.
|
|
|
|
|
|
| |
It was only used with Python 2 and unused/reserved with Python 3.
Python 3.8 has renamed the slot and is now using it for something different
which breaks our build.
|
|
|
|
|
|
| |
We did not free the array passed to us after marshalling, only the helper garray.
Patch by Tomasz Miąsko
|
|
|
|
|
|
|
|
|
| |
It returned NULL in case no error was set or if creating the error
result failed and this wasn't checked by the callers.
Change it to return Py_None in case no error was set and NULL in
case of an error. In pygi_error_check() we can't really forward the
error, so just print it and raise RuntimeError instead.
|
|
|
|
|
| |
_pygi_g_registered_type_info_check_object() is never called with
is_instance=FALSE.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
gtk crashes if gtk_init() fails and we can't do much about it.
This assumes the Gtk.Window() is the first instantiated widget and
raises an exception in case init failed.
We already had such a check but it was removed in 86a37d67455d
for some reason (maybe because it only helps in some cases)
|
|\
| |
| |
| |
| |
| |
| | |
gio overrides: emit a warning when creating various dbus types without a constructor. Fixes #15
Closes #15
See merge request GNOME/pygobject!107
|
| |
| |
| |
| |
| |
| |
| |
| | |
constructor. Fixes #15
We zero slice allocate them and the boxed copy/free functions don't handle that.
They just use ref counting which leads to double free because we start with a zero
refcount and the free funcs use g_free() while we allocate it with g_slice_alloc().
|
| |
| |
| |
| |
| |
| |
| | |
It's a bit faster and is a good chance to make sure both marshalling
paths behave the same and add some tests.
No functional change intended.
|
| |
| |
| |
| | |
set_string() allows it too
|
| |
| |
| |
| |
| | |
It already allows everything which can be passed to bool() except None.
I don't see a good reason for that so allow None as well.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The field marshalling code is slow and doesn't do any caching at all
which in turn makes accessing Value.g_type slow.
Add a static helper function for fetching the GType and use that instead.
This reduced the time for creating a GValue + setting it by ~30%
|
|/
|
|
|
| |
This wasn't documented but worked in most cases. Make sure no-one is depending
on it in the long run.
|
|
|
|
|
|
| |
We can move this into tp_dealloc now.
Only call unset() in the slice allocate case since g_boxed_free() will
do it anyway.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows us to assume that the wrapper is always valid and remove
the _is_valid attribute.
One difference now is that g_boxed_free() is called when the wrapper can no longer
be used and that breaks the custom glib sources where g_boxed_free() triggers
the finalize callback which tries to call into a method of the wrapper.
To work around this provide a _clear_boxed() method which allows the wrapper
to free the underlying boxed in __del__ where the wrapper is still usable.
|
| |
|
| |
|
|\
| |
| |
| |
| | |
pygi-info: wrap g_struct_info_find_method() and g_struct_info_find_field()
See merge request GNOME/pygobject!104
|
| |
| |
| |
| | |
Because why not.
|
|\ \
| | |
| | |
| | |
| | | |
Start using g_struct_info_find_field()
See merge request GNOME/pygobject!103
|
| |/
| |
| |
| |
| |
| |
| | |
Instead of iterating over the fields ourselves. g_struct_info_find_field() was added
for libgirepository 1.46: https://gitlab.gnome.org/GNOME/gobject-introspection/commit/cf6ea68018
We now depend on 1.46 so start using it.
|
|/
|
|
|
| |
Aligment is useful when validating ABI against C.
It is already wrapped for structs, wrap it for unions as well.
|
|
|
|
|
|
|
|
|
|
| |
TreeStore.insert_before allows passing parent as None in which case the parent
is derived from the sibling. The new code using insert_with_values() didn't take
this into account and simply passed the None along resulting in the row always getting
added at the toplevel.
Fix this by always passing a parent iter to insert_with_values() except when sibling is also
None and we want to add to the toplevel anyway.
|