Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Tom Englund
@gulafaran:matrix.org
[m]
Roman Gilg: yeah expand the list and any window and it should list a bunch of useful properties
Tom Englund
@gulafaran:matrix.org
[m]
Roman Gilg: are windows not a qobject anymore or toplevel or such?
Roman Gilg
@romangg:matrix.org
[m]
Tom Englund: They are still a qobject, but the Q_PROPERTY macros have been moved from Toplevel class to the script::window class.
So that's why the runtime may not find the properties anymore.
Tom Englund
@gulafaran:matrix.org
[m]
aha hm
Roman Gilg
@romangg:matrix.org
[m]
where are the properties read out in the debug console?
Tom Englund
@gulafaran:matrix.org
[m]
good question i think ive read through the source 10 times and i dont quite get it
Roman Gilg
@romangg:matrix.org
[m]
There is this console_model::propertyData function. maybe that's it.
2 replies
Tom Englund
@gulafaran:matrix.org
[m]
its like all its doing is checking for index, columns, rows and simply adds the window and it magically knows? :D
Roman Gilg
@romangg:matrix.org
[m]
And get_client_property_data
In get_client_property_data it does an implicit cast of the window to QObject* when calling propertyData
So maybe we could at this position cut the patient open and instead of doing a cast of the window a cast of the respective script::window.
This should at least work for windows published to the scripts system (windows with control in general).
So here don't cast from the window, but from the window in script namespace.
That's this class with all the juicy Q_PROPERTYs: https://gitlab.com/kwinft/kwinft/-/blob/master/scripting/window.h
Tom Englund
@gulafaran:matrix.org
[m]
Roman Gilg: well they dont inherit eachother so how do i cast that?
Roman Gilg
@romangg:matrix.org
[m]
I assume (hope) it's somewhat composited into it. Or if not (yet) then we need to go via the global space instance.
Let me quickly check.
So composited it is not :/
Ah no! It is composited :D
win::control::scripting
Get a pointer to the scripting interface of a window:
scripting::window* get_scripting (Toplevel& x)
{
    if (!x.control) {
        return nullptr;
    }
    return x.control->scripting.get();
}
Roman Gilg
@romangg:matrix.org
[m]
That should even allow to remove all if-cases and the virtual override of the get_client_property_data function.
But it also means we can't show properties at the moment of windows that don't have a control interface. :/
But still better than showing none at all. ;)
Tom Englund
@gulafaran:matrix.org
[m]
yeah il test :p
Roman Gilg
@romangg:matrix.org
[m]
Btw I'm working now for a week non-stop on this damn templating of everything. That's why I'm maybe not so reactive with replies and reviews at the moment. It's kind of exhausting. But there is light at the end of the tunnel.
Tom Englund
@gulafaran:matrix.org
[m]
Roman Gilg: oh dont worry, im mostly spending my late nights fiddling. trying to spend as much of my last vacation days out boating/chilling :D
Roman Gilg
@romangg:matrix.org
[m]
Sounds nice! 😄 Friend of me visited me on the weekend when travelling from Nordsee to Bayern. He was in Sweden with his van and girlfriend for a few days. He enjoyed it but on the photos it looked quite cold I have to say. At least a lot colder in comparison to how it is now in Berlin.
They liked the colder weather though.
Tom Englund
@gulafaran:matrix.org
[m]
Haha yeah well i guess its what you get used to june - august averages like 18 - 22C daytime with some random heatdays of 27, and nights is like 12 - 15C
I do live quite far up north 😂
Hm silly phone wont let me copy url, but luleå
2 replies
Tom Englund
@gulafaran:matrix.org
[m]
also sadly using scripting doesnt help either returns "objectName" anyways, and ofc nothing for internal windows etc without control hm
Tom Englund
@gulafaran:matrix.org
[m]
aha hold up we got a few get_property_index and get_property_count etc
Roman Gilg
@romangg:matrix.org
[m]
Right, I noticed on my refactors you also need to change type we get the property count from.
Tom Englund
@gulafaran:matrix.org
[m]
Roman Gilg: yay it works, so technically i could implent some kind of internal_window or window without control scripting classes for this aswell?
1 reply
or well hm "win->control->scripting.get();" no
Roman Gilg
@romangg:matrix.org
[m]
Then we would also not need to "misuse" the scripting::window class. Have it nicely separated instead.
Tom Englund
@gulafaran:matrix.org
[m]
yeah
Roman Gilg
@romangg:matrix.org
[m]
You could use the scripting::window class as a paragon though.
Maybe even make this in some way a class template, so scripting module and debug module can share code.
Q_PROPERTYS are a bit annoying here though. Maybe not a template class, just a virtual interface.
Roman Gilg
@romangg:matrix.org
[m]
Tom Englund: So my current "fix" for the debug properties you can find now on the base-object-2 branch I'm actively working on: romangg/kwinft@084e937
It falls back to reading the QObject properties of the Toplevel for windows without control. But of course there are no Q_PROPERTYs defined on the Toplevel class anymore.
Tom Englund
@gulafaran:matrix.org
[m]
Roman Gilg: right, i was tinkering around with interfaces/templates and see what could be done. but merge that i got nothing finalized :p
seems q property doesnt support class templates and bunch of other annoyances :(
1 reply
had some ideas about having something like window->debug a bit like window->control but not sure
Roman Gilg
@romangg:matrix.org
[m]
...which then is composited back into the actual class with a smart pointer.