After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730356 - Ensure reasonable values are written/used for window position GSettings
Ensure reasonable values are written/used for window position GSettings
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: client
master
Other Linux
: Normal minor
: 0.11.2
Assigned To: Michael Gratton
Geary Maintainers
: 735899 (view as bug list)
Depends on:
Blocks: 755359
 
 
Reported: 2014-05-19 07:45 UTC by Sebastian
Modified: 2016-08-16 15:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Ensure reasonable values are written/used for window position GSettings. (5.29 KB, patch)
2016-08-08 14:26 UTC, Michael Gratton
none Details | Review
Ensure reasonable values are written/used for window position GSettings (5.19 KB, patch)
2016-08-08 14:58 UTC, Michael Gratton
none Details | Review

Description Sebastian 2014-05-19 07:45:32 UTC
Hi,

i don't know what may have happened but since last week i cannot start geary anymore (i am compiling from source on Debian testing).

Everytime i start geary i get the following error:

(geary:7066): Gdk-WARNING **: Native Windows wider or taller than 32767 pixels are not supported

(geary:7066): Gdk-ERROR **: The program 'geary' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 304 error_code 11 request_code 53 (core protocol) minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/Breakpoint ausgelöst


Cheers,
Sebastian
Comment 1 André Klapper 2014-05-19 10:04:14 UTC
> To debug your program, run it with the GDK_SYNCHRONIZE environment
> variable to change this behavior.
Comment 2 Sebastian 2014-05-19 10:14:29 UTC
Hi André,

doesn't seem to change much:
[buster@Fry➔ ~] GDK_SYNCHRONIZE="1" geary --debug
 [msg] 12:12:42 0,026077 geary-application.vala:170: Geary 0.6.0 prefix=/home/buster exec_dir=/home/buster/bin is_installed=true
 [deb] 12:12:42 0,187698 null-indicator.vala:13: No messaging menu support in this build
 [deb] 12:12:42 0,012303 conversation-web-view.vala:181: Loading new message viewer style from /home/xxxx/.config/geary/user-message.css...
 [deb] 12:12:42 0,131793 db-versioned-database.vala:77: VersionedDatabase.upgrade: current database schema for /home/xxxx/geary.db: 21
 [deb] 12:12:42 0,090492 db-versioned-database.vala:77: VersionedDatabase.upgrade: current database schema for /home/xxxx/geary.db: 21
 [deb] 12:12:42 0,016003 smtp-outbox-folder.vala:139: Starting outbox postman

(geary:27822): Gdk-WARNING **: Native Windows wider or taller than 32767 pixels are not supported

(geary:27822): Gdk-ERROR **: The program 'geary' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 470 error_code 11 request_code 53 (core protocol) minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/Breakpoint ausgelöst
Comment 3 Jim Nelson 2014-05-19 21:25:58 UTC
One thing you might check:

* Run dconf Editor and look in org.yorba.geary, specifically window-height and window-width.  Are they reasonably sized?

If so, then please re-run Geary following these instructions:

https://wiki.gnome.org/Apps/Geary/ReportingABug

We'll be interested in seeing the stack trace.
Comment 4 Sebastian 2014-05-20 07:24:46 UTC
That seems to be it.
window-height is 65497.
After resetting to defaults it works.
I have no idea why the value is that high, though..
Comment 5 Jim Nelson 2014-05-20 18:32:18 UTC
I'm not sure either, but it sure looks like 16-bit underflow.

I'm changing this ticket to reflect the work we need to do, namely (a) ensure sane values are written out to GSettings and (b) since those values are externally modifiable, ensure only sane values are passed to GTK when read in
Comment 6 Jim Nelson 2014-10-09 01:38:03 UTC
*** Bug 735899 has been marked as a duplicate of this bug. ***
Comment 7 Michael Gratton 2016-08-08 14:17:39 UTC
As of 0.11.x the GSettings type (gint) and defaults seems fine, MainWindow::window_width and ::window_height are also gints, and so are the values they are set from (GdkEventConfigure::x and ::y), so I'm not sure where this might have crept in - maybe an X or GDK issue when creating the event?

In any case, I think this can be fixed by checking the values are reasonable against the current Gdk.Screen, if any. Patch to follow.
Comment 8 Michael Gratton 2016-08-08 14:26:16 UTC
Created attachment 332943 [details] [review]
Ensure reasonable values are written/used for window position GSettings.

Patch that uses Gdk.Screen to ensure values are sane. Also centres the window on the screen when mapped and fixes maximised state being lost.
Comment 9 Michael Gratton 2016-08-08 14:58:41 UTC
Created attachment 332946 [details] [review]
Ensure reasonable values are written/used for window position GSettings

Updated patch avoids redundant config writes at startup.
Comment 10 Michael Gratton 2016-08-11 09:00:52 UTC
Patch pushed to master as 979f3b9. I'll cherry pick this for geary-0.11 when it's been a bit more widely tested.
Comment 11 Michael Gratton 2016-08-16 15:30:23 UTC
This has been pushed to the stable geary-0.11 branch as ac6ceb9. Resolving as fixed.