mirror of
https://github.com/duncs/clusterssh.git
synced 2025-04-21 09:09:06 +00:00
Allow terminal positioning algorithm to be configurable
Previous change "Take into account WM decorations when tiling (Github pull request #66) (thanks to Andrew Stevenson)" has caused problems on some systems but improved tiling on others, so make the algorithm configurable to use the original one (default) or the new style. To be revisited when all the window handling code is moved into a separate module
This commit is contained in:
parent
b9a42101f1
commit
4266c2a06e
5 changed files with 30 additions and 10 deletions
1
Changes
1
Changes
|
@ -3,6 +3,7 @@
|
|||
- Correct a logic bug around the --debug option (Github issue #75)
|
||||
- Fix 'Re-add closed windows' not using the correct username (Github issue #72)
|
||||
- Update copyright year
|
||||
- Make WM decorations algorithm configurable as causes problems on some systems (Debian bug 842965, re Github pull request #66) (thanks to Tony Mancill)
|
||||
|
||||
4.08 2016-10-18 Duncan Ferguson <duncan_ferguson@user.sf.net>
|
||||
- Add perl-5.8, 5.10 and 5.12 to Travis-CI automated testing
|
||||
|
|
|
@ -1001,18 +1001,26 @@ sub retile_hosts {
|
|||
# now find the size of the window decorations
|
||||
if ( !exists( $self->config->{internal_terminal_wm_decoration_left} ) ) {
|
||||
|
||||
# use the first window as exemplary
|
||||
my ($wid) = $servers{ ( keys(%servers) )[0] }{wid};
|
||||
# Debian #842965 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842965)
|
||||
# disable behavior added in https://github.com/duncs/clusterssh/pull/66
|
||||
# unless explicitly enabled with auto_wm_decoration_offsets => yes
|
||||
|
||||
if ( defined($wid) ) {
|
||||
if ( $self->config->{auto_wm_decoration_offsets} =~ /yes/i ) {
|
||||
|
||||
# get the WM decoration sizes
|
||||
( $self->config->{internal_terminal_wm_decoration_left},
|
||||
$self->config->{internal_terminal_wm_decoration_right},
|
||||
$self->config->{internal_terminal_wm_decoration_top},
|
||||
$self->config->{internal_terminal_wm_decoration_bottom}
|
||||
)
|
||||
= X11::Protocol::WM::get_net_frame_extents( $xdisplay, $wid );
|
||||
# use the first window as exemplary
|
||||
my ($wid) = $servers{ ( keys(%servers) )[0] }{wid};
|
||||
|
||||
if ( defined($wid) ) {
|
||||
|
||||
# get the WM decoration sizes
|
||||
( $self->config->{internal_terminal_wm_decoration_left},
|
||||
$self->config->{internal_terminal_wm_decoration_right},
|
||||
$self->config->{internal_terminal_wm_decoration_top},
|
||||
$self->config->{internal_terminal_wm_decoration_bottom}
|
||||
)
|
||||
= X11::Protocol::WM::get_net_frame_extents( $xdisplay,
|
||||
$wid );
|
||||
}
|
||||
}
|
||||
|
||||
# in case the WM call failed we set some defaults
|
||||
|
|
|
@ -104,6 +104,8 @@ my %default_config = (
|
|||
|
||||
send_menu_xml_file => $ENV{HOME} . '/.clusterssh/send_menu',
|
||||
|
||||
auto_wm_decoration_offsets => "no", # Debian #842965
|
||||
|
||||
# don't set username here as takes precendence over ssh config
|
||||
user => '',
|
||||
);
|
||||
|
|
|
@ -633,6 +633,11 @@ would replace the <Alt-n> with the client's name in each window.}
|
|||
'L<--autoquit>',
|
||||
);
|
||||
|
||||
output '=item auto_wm_decoration_offsets = no';
|
||||
output $self->loc(
|
||||
'Enable or disable alternative algorithm for calculating terminal positioning.',
|
||||
);
|
||||
|
||||
output '=item comms = ' . $self->parent->config->{comms};
|
||||
output $self->loc(
|
||||
'Sets the default communication method (initially taken from the name of the program, but can be overridden here).'
|
||||
|
|
|
@ -118,6 +118,9 @@ Readonly::Hash my %default_config => {
|
|||
|
||||
send_menu_xml_file => $ENV{HOME} . '/.clusterssh/send_menu',
|
||||
|
||||
# Debian #842965
|
||||
auto_wm_decoration_offsets => "no",
|
||||
|
||||
# other bits inheritted from App::ClusterSSH::Base
|
||||
lang => 'en',
|
||||
user => '',
|
||||
|
@ -534,6 +537,7 @@ trap {
|
|||
my $expected = qq{# Configuration dump produced by "cssh -d"
|
||||
auto_close=5
|
||||
auto_quit=yes
|
||||
auto_wm_decoration_offsets=no
|
||||
console=console
|
||||
console_args=
|
||||
console_position=
|
||||
|
|
Loading…
Add table
Reference in a new issue