Bug 219568 - editors/emacs: split screen not correct with GTK3 and i3
Summary: editors/emacs: split screen not correct with GTK3 and i3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Ashish SHUKLA
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-26 09:39 UTC by Johannes Lundberg
Modified: 2017-07-17 16:16 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (ashish)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Lundberg 2017-05-26 09:39:23 UTC
The emacs25 I installed on 2017-05-25 has been built with GTK3 by default (this is new option I assume?). When using this with i3 wm the horizontal and vertical splits are incorrect. For example ctrl-x+3 gives me a 3 char wide left column and the rest is right column when it should be split in the middle. Emacs' e2wm becomes unusable with this bug. 

I updated the ports tree with portsnap and built a version using GTK2 and it works as expected, so the problem is with GTK3. 

Otherwise all my packages were upgraded as of 2017-05-25.
Kernel and world is drm-next, hw is Intel haswell.

No other GTK3 bugs has been in relation to this.
Comment 1 Ashish SHUKLA freebsd_committer freebsd_triage 2017-05-28 04:02:19 UTC
(In reply to Johannes Lundberg from comment #0)

Howdy

Sorry, I'm not around a FreeBSD computer for a week or two, so I won't be able to help at the moment. Although, feel free to post this problem to upstream development list, or report to their bug tracker[2] (which is what I would do too, after confirmation of problem), and link here.

References:
[1] https://lists.gnu.org/mailman/listinfo/emacs-devel
[2] M-x report-emacs-bug

HTH
Comment 2 Ashish SHUKLA freebsd_committer freebsd_triage 2017-06-17 17:40:38 UTC
(In reply to Johannes Lundberg from comment #0)

Back to my computer. I've installed i3-4.13, running emacs25-25.2_2,3, but not able to reproduce your issue. Emacs is built with following options:

	ACL            : on
	ALSA           : off
	CAIRO          : off
	CANNA          : on
	DBUS           : on
	GCONF          : on
	GFILE          : off
	GIF            : on
	GNUTLS         : on
	GSETTINGS      : on
	GTK2           : off
	GTK3           : on
	JPEG           : on
	KQUEUE         : on
	LLDB           : on
	M17N           : on
	MAGICK         : on
	MODULES        : on
	MOTIF          : off
	OSS            : on
	OTF            : on
	PNG            : on
	SCROLLBARS     : on
	SOURCES        : on
	SVG            : on
	TIFF           : on
	X11            : on
	XAW            : off
	XAW3D          : off
	XFT            : on
	XIM            : on
	XML            : on
	XPM            : on
	XWIDGETS       : off

GTK3 is 3.22.15, and is installed with following options:

	BROADWAY       : on
	CLOUDPRINT     : on
	COLORD         : on
	CUPS           : on
	DEBUG          : off

What options is your Emacs compiled with ?

Thanks!
Comment 3 Johannes Lundberg 2017-06-20 07:19:35 UTC
The normal split-screen seem to work fine for me now, not sure why it didn't work properly before. 

However, the package 'e2wm' does not display properly. Install it and try the different perspectives. Could it be an e2wm bug?
Comment 4 Ashish SHUKLA freebsd_committer freebsd_triage 2017-06-26 06:13:10 UTC
(In reply to Johannes Lundberg from comment #3)

Hi,

I tried to look, but I don't use e2wm, so I'm not sure how it should work, and there are no instructions to reproduce this issue.

As the project says:

"Warning: E2WM overrides Emacs lisp functions which is related to window manipulation. It is possible that E2WM does not work in your environment."

I would suggest filing a bug report with e2wm project, as it claims to be overriding core Emacs Lisp functions, and it's very possible the emacs update broke e2wm, and they need to play catch up.

I'm closing this PR, as the original issue (with horizontal/vertical splits) is not reproducible anymore.

Thanks!
Comment 5 Johannes Lundberg 2017-06-27 16:18:12 UTC
I discovered that this is not at all e2wm related when running emacs on low dpi screen. 

The problem is, I believe, that emacs doesn't respect scale factor for position of scrollbars (for GTK3). 

With these settings with my HiDPI screen:

xrandr --dpi 192
gsettings set org.gnome.desktop.interface scaling-factor 2

I can see the bug when splitting the window with C-x 3.

The "window" is split at correct X position but the scrollbar is placed at 2*X position. 

Setting 
gsettings set org.gnome.desktop.interface scaling-factor 1
and it is displayed correctly.

Reopening the bug.
Comment 6 Johannes Lundberg 2017-06-27 16:53:22 UTC
Building with 

	SCROLLBARS     : off

solves the problem for now. I can use it with GTK3.
Comment 7 Ashish SHUKLA freebsd_committer freebsd_triage 2017-06-27 17:05:39 UTC
(In reply to Johannes Lundberg from comment #5)

I don't have any HiDPI screen to reproduce the problem. Although, I see a similar bug report[1] upstream.

Maybe you can follow-up there, with screenshots, or something to demonstrate your issue.

Thanks!

References:

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20619
Comment 8 Johannes Lundberg 2017-06-27 17:07:08 UTC
I don't think you need any special screen, just set gtk scale factor > 1. 

I will check upstream what they're saying.
Comment 9 Johannes Lundberg 2017-07-17 16:16:46 UTC
This should be fixed in upstream master now.