unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* NS port and fancy OS X scrollbars
@ 2016-02-23 23:27 Alan Third
  2016-02-24  9:56 ` Anders Lindgren
  2016-02-24 21:21 ` Alan Third
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Third @ 2016-02-23 23:27 UTC (permalink / raw)
  To: emacs-devel; +Cc: Anders Lindgren

I was reading through Anders's wish-list for the NS port and noticed
the bit about implementing the new OS X 'floating' scroll bars. As I'd
been looking at scrollbars for a bug report anyway I figured I'd try
to work out what would be required.

As far as I can tell the 'right' way to do it is to create an
NSScrollView and put your buffer content into another NSView within
it. This seems to give you native scrollbars for a lot less work than
is being done at the moment. However I think we'd lose the ability to
put the vertical scrollbars on the left. I don't know how important
that feature is.

I think there's a bigger problem, though. It looks to me like the mode
line is currently drawn into the same NSView as the rest of the
buffer, so just wrapping the current NSView with an NSScrollView would
result in the vertical scrollbar overlapping the mode line, and the
horizontal scrollbar below it.

Am I right about this? If so then it seems the only way to get the
floating scrollbars would be to recreate the effect ourselves, which I
suspect is rather a lot of work.
-- 
Alan Third



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NS port and fancy OS X scrollbars
  2016-02-23 23:27 NS port and fancy OS X scrollbars Alan Third
@ 2016-02-24  9:56 ` Anders Lindgren
  2016-02-24 19:34   ` Alan Third
  2016-02-24 21:21 ` Alan Third
  1 sibling, 1 reply; 5+ messages in thread
From: Anders Lindgren @ 2016-02-24  9:56 UTC (permalink / raw)
  To: Alan Third; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]

Hi!


> As far as I can tell the 'right' way to do it is to create an
>
NSScrollView and put your buffer content into another NSView within
> it. This seems to give you native scrollbars for a lot less work than
> is being done at the moment. However I think we'd lose the ability to
> put the vertical scrollbars on the left. I don't know how important
> that feature is.
>

It's hard to know. One way to handle this is to keep both implementations
around. Clearly, the combination of having scroll bars to the left and make
them floating won't be supported. This might be needed anyway since I'm not
sure if GNUStep supports floating scroll bars.


I think there's a bigger problem, though. It looks to me like the mode
> line is currently drawn into the same NSView as the rest of the
> buffer, so just wrapping the current NSView with an NSScrollView would
> result in the vertical scrollbar overlapping the mode line, and the
> horizontal scrollbar below it.
>

Unfortunately, I never looked into the technical details, so I can't say
whether this is the right way to handle it.

However, then I wrote this I envisioned a layout that would be identical to
when scroll bars were disabled, but that they should appear when the user
scrolled the text using the mouse. Clearly, the scroll bar should not cover
the mode line, the minibuffer/echo area, nor the header line (if present).


Am I right about this? If so then it seems the only way to get the
> floating scrollbars would be to recreate the effect ourselves, which I
> suspect is rather a lot of work.
>

If you are correct, then I would suggest that we shouldn't pursue this. If
it's not possible to implement this in a clean OS friendly manner, we risk
ending up with complex, fragile, code that might not work on future OS X
versions.

    -- Anders

[-- Attachment #2: Type: text/html, Size: 2895 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NS port and fancy OS X scrollbars
  2016-02-24  9:56 ` Anders Lindgren
@ 2016-02-24 19:34   ` Alan Third
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Third @ 2016-02-24 19:34 UTC (permalink / raw)
  To: Anders Lindgren; +Cc: emacs-devel

On Wed, Feb 24, 2016 at 10:56:36AM +0100, Anders Lindgren wrote:
> It's hard to know. One way to handle this is to keep both implementations
> around. Clearly, the combination of having scroll bars to the left and make
> them floating won't be supported. This might be needed anyway since I'm not
> sure if GNUStep supports floating scroll bars.

The good side of this is that if we did implement an NSScrollView to
handle the scroll bars then GNUStep and older versions of OS X that
don't support the floating versions will fall-back to the "legacy"
scroll bars. At least, that's how the documentation reads to me.

It would also mean that whether the scroll bars were floating or
legacy would depend on the system setting in system preferences ->
general. Although we could force them back to legacy at runtime if
required.

Here's a wee bit of information on when you do and dont' get floating
scrollbars:

https://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_7.html#//apple_ref/doc/uid/TP40010355-SW3

(search for "overlay scrollbars")

> Am I right about this? If so then it seems the only way to get the
> > floating scrollbars would be to recreate the effect ourselves, which I
> > suspect is rather a lot of work.
> >
> 
> If you are correct, then I would suggest that we shouldn't pursue this. If
> it's not possible to implement this in a clean OS friendly manner, we risk
> ending up with complex, fragile, code that might not work on future OS X
> versions.

I think we need to find someone who knows a bit more about exactly how
Emacs draws windows or I need to just keep looking until I figure out
how it works.

Thanks!
-- 
Alan Third



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NS port and fancy OS X scrollbars
  2016-02-23 23:27 NS port and fancy OS X scrollbars Alan Third
  2016-02-24  9:56 ` Anders Lindgren
@ 2016-02-24 21:21 ` Alan Third
  2016-02-28 13:04   ` Bozhidar Batsov
  1 sibling, 1 reply; 5+ messages in thread
From: Alan Third @ 2016-02-24 21:21 UTC (permalink / raw)
  To: emacs-devel; +Cc: Anders Lindgren

On Tue, Feb 23, 2016 at 11:27:44PM +0000, Alan Third wrote:
> As far as I can tell the 'right' way to do it is to create an
> NSScrollView and put your buffer content into another NSView within
> it. This seems to give you native scrollbars for a lot less work than
> is being done at the moment. However I think we'd lose the ability to
> put the vertical scrollbars on the left. I don't know how important
> that feature is.
> 
> I think there's a bigger problem, though. It looks to me like the mode
> line is currently drawn into the same NSView as the rest of the
> buffer, so just wrapping the current NSView with an NSScrollView would
> result in the vertical scrollbar overlapping the mode line, and the
> horizontal scrollbar below it.

Ignore this. After a bit more investigation it looks like it's
perfectly easy to position the NSScrollers anywhere within an
NSScrollView, so I'll just shut up now and try implementing it.

-- 
Alan Third



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NS port and fancy OS X scrollbars
  2016-02-24 21:21 ` Alan Third
@ 2016-02-28 13:04   ` Bozhidar Batsov
  0 siblings, 0 replies; 5+ messages in thread
From: Bozhidar Batsov @ 2016-02-28 13:04 UTC (permalink / raw)
  To: Alan Third; +Cc: Anders Lindgren, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]

Looking forward to seeing this implemented!

On 24 February 2016 at 23:21, Alan Third <alan@idiocy.org> wrote:

> On Tue, Feb 23, 2016 at 11:27:44PM +0000, Alan Third wrote:
> > As far as I can tell the 'right' way to do it is to create an
> > NSScrollView and put your buffer content into another NSView within
> > it. This seems to give you native scrollbars for a lot less work than
> > is being done at the moment. However I think we'd lose the ability to
> > put the vertical scrollbars on the left. I don't know how important
> > that feature is.
> >
> > I think there's a bigger problem, though. It looks to me like the mode
> > line is currently drawn into the same NSView as the rest of the
> > buffer, so just wrapping the current NSView with an NSScrollView would
> > result in the vertical scrollbar overlapping the mode line, and the
> > horizontal scrollbar below it.
>
> Ignore this. After a bit more investigation it looks like it's
> perfectly easy to position the NSScrollers anywhere within an
> NSScrollView, so I'll just shut up now and try implementing it.
>
> --
> Alan Third
>
>

[-- Attachment #2: Type: text/html, Size: 1600 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-28 13:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-23 23:27 NS port and fancy OS X scrollbars Alan Third
2016-02-24  9:56 ` Anders Lindgren
2016-02-24 19:34   ` Alan Third
2016-02-24 21:21 ` Alan Third
2016-02-28 13:04   ` Bozhidar Batsov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).