Closed
Bug 1209659
Opened 9 years ago
Closed 9 years ago
set GTK_CSD=1 - GTK 3: Dialog size not set correctly
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: freaktechnik, Unassigned)
References
()
Details
(Keywords: regression)
Attachments
(4 files, 3 obsolete files)
62.46 KB,
image/png
|
Details | |
93.67 KB,
image/png
|
Details | |
1.24 KB,
patch
|
karlt
:
review+
|
Details | Diff | Splinter Review |
1.24 KB,
patch
|
Details | Diff | Splinter Review |
Whenever any kind of dialog is shown, only the titlebar is displayed by default. The content can be revealed by resizing the dialog window. See the attachment for an example of the "do you really want to close all open tabs" warning. This is on elementary OS freya with GTK 3.14.15 and the OS default theme. The "about" dialog shows some content, but not all, a screenshot I'll attach next.
Reporter | ||
Comment 1•9 years ago
|
||
Reporter | ||
Comment 2•9 years ago
|
||
I forgot to mention that I get these warnings when running Nightly from the console: *** BUG *** In pixman_region32_init_rect: Invalid rectangle passed Set a breakpoint on '_pixman_log_error' to debug
Comment 4•9 years ago
|
||
Also caused by GTK_CSD=1.
Summary: GTK 3: Dialog size not set correctly → set GTK_CSD=1 - GTK 3: Dialog size not set correctly
Reporter | ||
Comment 5•9 years ago
|
||
I've noticed when working with the instantbird nightly, that windows with saved sizes get smaller and smaller (in Instantbird that affects the Add-on Manager, the account manager, the buddy list and the chat window...). It feels as if The size is set with the border that doesn't get repainted included and then the size of the child window gets safed, but that's a completely untested assumption, from how much the windows shrink. This could also explain the errors for small dialogs, since there is not enough space for a child window within the set size.
Comment 6•9 years ago
|
||
I suspect the GtkHeaderBar causes that, it's automatically added as a child widget of every window in CSD mode and we're not aware of it.
Comment 7•9 years ago
|
||
It's caused by broken gtk_window_resize(), it counts CSD extents to the window size: https://bugzilla.redhat.com/show_bug.cgi?id=1269437
Comment 8•9 years ago
|
||
This one utilizes the gtk container allocation mechanism, see: https://bugzilla.redhat.com/show_bug.cgi?id=1269437#c11 for details. I'm not sure about the NativeResize() - is it okay to move it after the allocation check? Thanks!
Attachment #8673059 -
Flags: review?(karlt)
Comment 9•9 years ago
|
||
Tracking this since it's a recent regression, and setting affected branch flags based on bug 1195002.
status-firefox42:
--- → unaffected
status-firefox43:
--- → affected
status-firefox44:
--- → affected
tracking-firefox43:
--- → +
tracking-firefox44:
--- → +
Keywords: regression
Comment 10•9 years ago
|
||
Comment on attachment 8673059 [details] [diff] [review] patch https://bugzilla.redhat.com/show_bug.cgi?id=1269437#c13 Removing review request as Matthias is questioning this approach.
Attachment #8673059 -
Flags: review?(karlt)
Comment 11•9 years ago
|
||
Gtk bug: https://bugzilla.gnome.org/show_bug.cgi?id=756618 Karl, may we use the allocation workaround for older Gtk releases?
Updated•9 years ago
|
Flags: needinfo?(karlt)
Comment 12•9 years ago
|
||
I don't really know what the consequences of this workaround might be, but gtk_widget_size_allocate sounds scary. I think a better solution is to temporarily unset GTK_CSD on affected versions at the appropriate time (realize, perhaps?).
Flags: needinfo?(karlt)
Comment 13•9 years ago
|
||
I'd take a fix for this along the lines of comment 12, but I don't think this is a must-fix for shipping the GTK3 port. I think it is reasonable to expect distros that set GTK3_CSD to use a version of gtk that works with that setting.
No longer blocks: ship-gtk3
Comment 14•9 years ago
|
||
(In reply to Karl Tomlinson (ni?:karlt) from comment #12) > I think a better solution is to temporarily unset GTK_CSD on affected > versions at the appropriate time (realize, perhaps?). GTK_CSD has to be disabled all the time. It's checked by get_shadow_width() which computes window border for window positioning/scaling.
Comment 15•9 years ago
|
||
There's the patch if we need it.
Attachment #8683640 -
Flags: review?(karlt)
Comment 16•9 years ago
|
||
Comment on attachment 8683640 [details] [diff] [review] csd disable patch (In reply to Martin Stránský from comment #14) > GTK_CSD has to be disabled all the time. It's checked by get_shadow_width() > which computes window border for window positioning/scaling. Ah, OK thanks. I'm happy to save people with GTK versions < 3.20 from the perils of CSD. >+++ b/toolkit/xre/nsAppRunner.cpp >+#if (MOZ_WIDGET_GTK == 3) >+ // Workaround for bug 1209659 which is fixed by Gtk3.20 >+ if(gtk_check_version(3, 20, 0)) >+ PR_SetEnv("GTK_CSD=0"); >+#endif Because libxul is a dynamic library it will be unloaded before the program exists, which means that we can't leave pointers to data in the library in the environment. Also, the environment is mutable (not const), ruling out literal strings. Although leaking a string is often the typical solution for adding an environment variable, in this case unsetenv() is a nicer solution. Can you move this to nsAppShell::Init(), please? We'd like to keep platform-specific code out of nsAppRunner where not absolutely necessary. Here this just needs to be set before the first visible window is created. nsAppShell::Init() sets up the event loop so should be early enough.
Attachment #8683640 -
Flags: review?(karlt) → review-
Comment 17•9 years ago
|
||
Thanks, so something like that?
Attachment #8683640 -
Attachment is obsolete: true
Attachment #8687208 -
Flags: review?(karlt)
Comment 18•9 years ago
|
||
Comment on attachment 8687208 [details] [diff] [review] patch v.2 >@@ -129,16 +134,20 @@ nsAppShell::Init() >+ // Workaround for bug 1209659 which is fixed by Gtk3.20 >+ if(gtk_check_version(3, 20, 0) != nullptr) >+ PR_SetEnv("GTK_CSD=0"); Use unsetenv("GTK_CSD") here instead of PR_SetEnv, and the code in the destructor is not required. That is simpler and avoids the problem with a dangling pointer should exit() be called without destroying the nsAppShell and puts no const data in the environment.
Attachment #8687208 -
Flags: review?(karlt) → review-
Comment 19•9 years ago
|
||
This also doesn't restore whatever was set when executing subprocesses (like when opening a downloaded file with a helper application)
Comment 20•9 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #19) > This also doesn't restore whatever was set when executing subprocesses (like > when opening a downloaded file with a helper application) Yes, but that's not really a practical option. A temporary setenv is not possible because GTK will check the env again when resizing (at least). Keeping a record to restore env before fork is not worth the effort IMO. https://bugzilla.gnome.org/show_bug.cgi?id=756618 will also affect other applications and we would be doing people a favour by saving them from that bug and CSD in general (c.f. bug 1195002 comment 28.).
Comment 21•9 years ago
|
||
(In reply to Karl Tomlinson (ni?:karlt) from comment #20) > https://bugzilla.gnome.org/show_bug.cgi?id=756618 will also affect other > applications and we would be doing people a favour by saving them from that > bug and CSD in general (c.f. bug 1195002 comment 28.). Also that's a temporary workaround until fixed gtk 3.20 hits the users.
Comment 22•9 years ago
|
||
Fixed one.
Attachment #8673059 -
Attachment is obsolete: true
Attachment #8687208 -
Attachment is obsolete: true
Attachment #8687835 -
Flags: review?(karlt)
Comment 23•9 years ago
|
||
Comment on attachment 8687835 [details] [diff] [review] patch v.3 >+ if(gtk_check_version(3, 20, 0) != nullptr) Space between "if" and "(" for Mozilla style. Thanks!
Attachment #8687835 -
Flags: review?(karlt) → review+
Comment 24•9 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ae94dcf741c0
Updated•9 years ago
|
Keywords: checkin-needed
Comment 25•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/7896f468df7e
Keywords: checkin-needed
Comment 26•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7896f468df7e
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Karl, Martin: Does this need to be uplifted to Aurora44?
Flags: needinfo?(stransky)
Flags: needinfo?(karlt)
Comment 28•9 years ago
|
||
I don't think it is important to uplift to 44 (for the reasons in comment 13), thanks.
Flags: needinfo?(karlt)
(In reply to Karl Tomlinson (ni?:karlt) from comment #28) > I don't think it is important to uplift to 44 (for the reasons in comment > 13), thanks. Thanks Karl. In that case we will mark this as wontfix for FF44.
Comment 30•9 years ago
|
||
Wontfix for 43 as well.
Updated•9 years ago
|
Flags: needinfo?(stransky)
You need to log in
before you can comment on or make changes to this bug.
Description
•