diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-13 09:10:36 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-13 09:10:47 -0400 |
commit | ceb0bce971026944d4cc2cc900acab7b4f68c57e (patch) | |
tree | 9e9db451f982314b9cd2e8054e2ccaac02ae0e5c /libs/gtkmm2ext | |
parent | 690cc23ed2b071e4c647d42b27a0c22269582f8b (diff) |
write some code to limit pane handle positions on OS X.
So far untested, and uncompiled
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r-- | libs/gtkmm2ext/pane.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libs/gtkmm2ext/pane.cc b/libs/gtkmm2ext/pane.cc index e288e6f350..2cd05c1681 100644 --- a/libs/gtkmm2ext/pane.cc +++ b/libs/gtkmm2ext/pane.cc @@ -418,6 +418,46 @@ Pane::set_divider (Dividers::size_type div, float fract) fract = max (0.0f, min (1.0f, fract)); +#ifdef __APPLE__ + + /* On Quartz, if the pane handle (divider) gets to + be adjacent to the window edge, you can no longer grab it: + any attempt to do so is interpreted by the Quartz window + manager ("Finder") as a resize drag on the window edge. + */ + + if (horizontal) { + if (div == dividers.size() - 1) { + if (get_allocation().get_width() * (1.0 - fract) < (divider_width*2)) { + /* too close to right edge */ + return; + } + } + + if (div == dividers.size() - 1) { + if (get_allocation().get_width() * fract < (divider_width*2)) { + /* too close to left edge */ + return; + } + } + } else { + if (div == dividers.size() - 1) { + if (get_allocation().get_height() * (1.0 - fract) < (divider_width*2)) { + /* too close to bottom */ + return; + } + } + + if (div == dividers.size() - 1) { + if (get_allocation().get_width() * fract < (divider_width*2)) { + /* too close to top */ + return; + } + } + } + +#endif + if (fract != (*d)->fract) { (*d)->fract = fract; /* our size hasn't changed, but our internal allocations have */ |