summaryrefslogtreecommitdiff
path: root/freefilesync/debian/patches/revert_buggy_gtk3_change_in_12.1.patch
blob: 78fed20b9ccaaea499b4e73926bf178a79201701 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
Description: Revert change that provokes freeze when opening dialogs
 With upstream's 12.1 version, there started to be a freeze when opening
 some dialogs. Upstream author identified this might come from a given change
 detailed in https://freefilesync.org/forum/viewtopic.php?t=10103
 .
 Until the problem is fixed upstream, this patch reverts that change.
Author: Fab Stz <fabstz-it@yahoo.fr>
Origin: self
Bug: https://freefilesync.org/forum/viewtopic.php?t=10103
Forwarded: https://freefilesync.org/forum/viewtopic.php?t=10103
Last-Update: 2023-09-13
Version: 13.0

--- a/FreeFileSync/Source/ui/abstract_folder_picker.cpp
+++ b/FreeFileSync/Source/ui/abstract_folder_picker.cpp
@@ -127,10 +127,7 @@
 
     //----------------------------------------------------------------------
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     Bind(wxEVT_CHAR_HOOK,            [this](wxKeyEvent&  event) { onLocalKeyEvent(event); }); //dialog-specific local key events
--- a/FreeFileSync/Source/ui/batch_config.cpp
+++ b/FreeFileSync/Source/ui/batch_config.cpp
@@ -82,10 +82,7 @@
     Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_buttonSaveAs->SetFocus();
--- a/FreeFileSync/Source/ui/progress_indicator.cpp
+++ b/FreeFileSync/Source/ui/progress_indicator.cpp
@@ -221,10 +221,7 @@
     m_panelErrorStats->Layout();
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
 }
 
 
@@ -924,10 +921,6 @@
     //make sure that standard height matches ProcessPhase::binaryCompare statistics layout (== largest)
 
     this->GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    this->Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    this->Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
     pnl_.Layout();
     this->Center(); //call *after* dialog layout update and *before* wxWindow::Show()!
 
--- a/FreeFileSync/Source/ui/small_dlgs.cpp
+++ b/FreeFileSync/Source/ui/small_dlgs.cpp
@@ -144,10 +144,6 @@
     //--------------------------------------------------------------------------
     //have animal + text match *final* dialog width
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
 
     {
         const int imageWidth = (m_panelDonate->GetSize().GetWidth() - 5 - 5 - 5 /* grey border*/) / 2;
@@ -163,10 +159,7 @@
     Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_buttonClose->SetFocus(); //on GTK ESC is only associated with wxID_OK correctly if we set at least *any* focus at all!!!
@@ -400,11 +393,7 @@
     m_checkBoxPasswordPrompt->Hide();
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-    //=> works like a charm for GTK with window resizing problems and title bar corruption; e.g. Debian!!!
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     updateGui(); //*after* SetSizeHints when standard dialog height has been calculated
@@ -968,10 +957,7 @@
     Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_buttonOK->SetFocus();
@@ -1085,10 +1071,7 @@
     Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_buttonOK->SetFocus();
@@ -1228,10 +1211,7 @@
     setIntValue(*m_staticTextDeleteRight, st.deleteCount<SelectSide::right>(), *m_bitmapDeleteRight, "so_delete_right_sicon");
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_buttonStartSync->SetFocus();
@@ -1495,10 +1475,7 @@
     updateGui();
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     //restore actual value:
@@ -1818,10 +1795,7 @@
     Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_buttonOkay->SetFocus();
@@ -1917,10 +1891,7 @@
     m_textCtrlPasswordVisible->Hide();
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     updateGui(); //*after* SetSizeHints when standard dialog height has been calculated
@@ -2003,10 +1974,7 @@
     m_spinCtrlOverdueDays->SetValue(cfgHistSyncOverdueDays);
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_spinCtrlOverdueDays->SetFocus();
@@ -2074,10 +2042,7 @@
     m_textCtrlOfflineActivationKey->ChangeValue(manualActivationKey);
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_buttonActivateOnline->SetFocus();
@@ -2182,12 +2147,8 @@
     updateGui();
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
-
     Show();
 
     //clear gui flicker: window must be visible to make this work!
--- a/FreeFileSync/Source/ui/sync_cfg.cpp
+++ b/FreeFileSync/Source/ui/sync_cfg.cpp
@@ -706,10 +706,7 @@
     selectFolderPairConfig(-1);
 
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     //keep stable sizer height: change-based directions are taller than difference-based ones => init with SyncVariant::twoWay
--- a/wx+/popup_dlg.cpp
+++ b/wx+/popup_dlg.cpp
@@ -283,17 +283,12 @@
         //set std order after button visibility was set
         setStandardButtonLayout(*bSizerStdButtons, stdBtns);
 
-        updateGui();
 
+        updateGui();
 
         GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-        Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-        Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
         Center(); //needs to be re-applied after a dialog size change!
 
-
         Raise(); //[!] popup may be triggered by ffs_batch job running in the background!
 
         if (m_buttonAccept->IsEnabled())
--- a/wx+/tooltip.cpp
+++ b/wx+/tooltip.cpp
@@ -80,12 +80,11 @@
     }
 
     if (imgChanged || txtChanged)
+    {
         //tipWindow_->Dimensions(); -> apparently not needed!?
         tipWindow_->GetSizer()->SetSizeHints(tipWindow_); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    //=> call wxWindow::Show() to "execute"
-#endif
+        //Linux: Fit() seems to be broken => call EVERY time inside show, not only if text or bmp change -> still true?!?
+    }
 
     const wxPoint newPos = wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ?
                            mousePos - wxPoint(fastFromDIP(TIP_WINDOW_OFFSET_DIP) + tipWindow_->GetSize().GetWidth(), 0) :
--- a/FreeFileSync/Source/ui/rename_dlg.cpp
+++ b/FreeFileSync/Source/ui/rename_dlg.cpp
@@ -354,10 +354,7 @@
 
     //-----------------------------------------------------------
     GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize()
-#ifdef __WXGTK3__
-    Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088
-    Hide(); //avoid old position flash when Center() moves window (asynchronously?)
-#endif
+    //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!!
     Center(); //needs to be re-applied after a dialog size change!
 
     m_textCtrlNewName->SetFocus(); //[!] required *before* SetSelection() on wxGTK
bgstack15