Sergio Martins
3bab6cad59
In checkSanity(), check the anchors before the items
...
Since anchors are easier to debug it's better to see those warnings
first
2019-07-23 22:19:26 +01:00
Sergio Martins
976a846f14
Emit widgetCountChanged only at the end when restoring
...
Otherwise it triggers code that shouldn't run while restore
is in progress
2019-07-23 22:18:45 +01:00
Sergio Martins
2ab56f47f0
Don't crash in AnchorGroup::debug() as anchors can be nullptr
...
Anchors shouldn't be null, but this debug() is called when weird
things happen so we can debug them, so dont crash
2019-07-23 21:30:40 +01:00
Sergio Martins
c5842eb34d
Dont' reparent FloatingWindow when restoring it
...
Instead pass the correct parent from the beginning.
Otherwise causes a bug in X11 where the FloatingWindow would
disappear sometimes, even if isVisible() and geometry were correct.
The test doesn't really catch it, as the properties are correct,
but visually it can be seen. Commiting the test anyway.
2019-07-23 18:46:09 +01:00
Sergio Martins
edf1d74044
Reenable tst_restoreCrash, it passes
2019-07-23 18:04:56 +01:00
Sergio Martins
7c4a7caa40
Fix restored Frame not calling updateTitleBarVisibility()
...
It's called when parent changes. We could just call it after restoring
but I rather have the paths normalized, so now it uses the same path
when restoring as when adding
2019-07-23 17:42:46 +01:00
Sergio Martins
10c2b0fa77
Reenable layout storing
2019-07-23 17:08:54 +01:00
Sergio Martins
0243dd4ed4
Add a more complex test
2019-07-23 16:59:36 +01:00
Sergio Martins
f585f06422
Restore geometry of closed dock widgets too
2019-07-23 15:08:14 +01:00
Sergio Martins
6e550c05c5
When restoring FloatingWindow set the correct window flags
...
It wasn't being created as a window
2019-07-23 13:52:52 +01:00
Sergio Martins
0c0c3975a3
Silence debug
2019-07-23 13:45:00 +01:00
Sergio Martins
a9a9e3b828
Be sure to have the static anchors set before calling addItems_internal()
2019-07-23 13:33:59 +01:00
Sergio Martins
a251e827ce
Restore geometry first
...
So we don't get resize events doing extra work after
2019-07-23 13:31:43 +01:00
Sergio Martins
d4ba1f3c8c
Don't keep stale static anchors around
2019-07-23 12:07:27 +01:00
Sergio Martins
1c93e74b6a
Use addItems_internal() when adding the item
...
It installs an event filter
2019-07-23 11:55:54 +01:00
Sergio Martins
43f3030979
pass Anchor by pointer so it's normalized
2019-07-23 11:51:36 +01:00
Sergio Martins
b6889b5c54
No need to assign to m_anchors
...
Anchor CTOR does that
2019-07-23 11:49:28 +01:00
Sergio Martins
ab24161657
Remove unneeded Frame::id()
2019-07-23 11:42:52 +01:00
Sergio Martins
0e1b473db7
Also restore item's anchors
2019-07-23 11:35:00 +01:00
Sergio Martins
b14f66ee13
Check for invalid groups in checkSanity()
2019-07-23 11:23:36 +01:00
Sergio Martins
52c1cd510e
Fix typos
2019-07-22 23:19:54 +01:00
Sergio Martins
574b9fbfa3
Set frame visible when restoring it
2019-07-22 23:05:53 +01:00
Sergio Martins
6c5ad286f3
Disconnect earlier, so we don't crash when deleting directly
2019-07-22 21:51:27 +01:00
Sergio Martins
3ef09fde11
Move code to where it's used
2019-07-22 19:46:30 +01:00
Sergio Martins
8cca303e1b
Delete Frame immediately instead of deleteLater when possible
...
Otherwise a LayoutSaver::saveLayout() will count with those frames
that aren't deleted yet and are keeping Items alive.
Also easier for tests, not so many waitForDeleted() needed
2019-07-22 18:40:01 +01:00
Sergio Martins
7b202fee5a
Hide dock widgets before clearing layout
...
So that dock widgets are unparented before clearing the layout
Fixes a regression introduced recently. Tests pass now
2019-07-22 17:50:42 +01:00
Sergio Martins
7e02d2d953
Fix tests broken due to non-unique MainWindow/DockWidget names
2019-07-22 17:50:22 +01:00
Sergio Martins
947969438d
LayoutSaver: Make the deserializer match the serializer
...
They must be simmetric
2019-07-22 17:32:24 +01:00
Sergio Martins
c253962f87
Make DockRegistry::nestedWindows() not return the ones being deleted
2019-07-22 17:31:49 +01:00
Sergio Martins
bc93f924fc
Disable the Animated Indicators for now
...
They don't work yet
2019-07-22 11:18:43 +01:00
Sergio Martins
9cad96b8ef
Add needed friend declaration
2019-07-22 11:10:17 +01:00
Sergio Martins
14a393dfb3
Remove dead code from LayoutSaver
2019-07-22 10:50:29 +01:00
Sergio Martins
1cecc30c54
Also save/restore window geometry and visibility
...
also restore the FloatingWindow
2019-07-22 10:44:11 +01:00
Sergio Martins
ddb772d54f
Fix clazy build
2019-07-22 09:34:15 +01:00
Sergio Martins
05532b892c
Fix build
2019-07-21 23:43:42 +01:00
Sergio Martins
4acced799c
Ensure all floating DockWidgets morphed into a FloatingWindow before saving
...
Makes it easier, since it's less one case to handle
2019-07-21 23:42:22 +01:00
Sergio Martins
228870df68
Serialize FloatingWindow
2019-07-21 23:42:08 +01:00
Sergio Martins
f1d5fd4b67
Before restoring a layout, clear old placeholders too
2019-07-21 23:28:06 +01:00
Sergio Martins
5274c8a9fd
Rename method
2019-07-21 23:27:58 +01:00
Sergio Martins
38d97ef00b
Comment out dead code
...
Just there for reference, but will be removed soon
2019-07-21 23:27:30 +01:00
Sergio Martins
35bb63946a
Add serializers for Item, Frame and DockWidget
2019-07-21 23:15:19 +01:00
Sergio Martins
ed2bd24f46
Fix crash while restoring empty layout
2019-07-21 20:29:42 +01:00
Sergio Martins
dfc53795b7
Start implementing global save/restore
...
The difference is that now ach class will encapsulate serialization/deserialization
of its own properties, and we'll get rid of the *State classes
2019-07-21 19:08:35 +01:00
Sergio Martins
a410224a1d
DockRegistry now warns about MainWindows missing a name too
2019-07-21 18:45:25 +01:00
Sergio Martins
f8560c18ca
Comment out LauoutSaver public api for now
...
Still working on it
2019-07-21 18:25:30 +01:00
Sergio Martins
c684942ece
Add a serializer for Anchor class
...
Will be used for restoring layout
2019-07-21 00:15:41 +01:00
Sergio Martins
b8307a4299
cmake adjustments suggested by jcelerier
2019-07-20 22:50:21 +01:00
Sergio Martins
2b5ce7a197
Merge pull request #12 from KDAB/cmake_cleanup
...
Clean up cmake files
2019-07-20 22:46:16 +01:00
Sergio Martins
bb1a933137
Transform floating dock widgets into FloatingWindow
...
instead of waiting for the user to drag a window over it.
This makes it have better z-order, as the FloatingWindow is parented.
2019-07-20 22:15:24 +01:00
Sergio Martins
d98e5dd966
Wayland debug++
2019-07-20 19:05:01 +01:00