From e92fd3736fc6e9c7fca7c991cc4d553459c9f4c0 Mon Sep 17 00:00:00 2001 From: gryf Date: Sun, 18 Sep 2022 14:47:25 +0200 Subject: [PATCH] Added option for changing refreshing behaviour. It may happen, that on specific systems with certain font screen flickering might occur. By setting new resource 'URxvt.tabbedalt.stop-flickering' to true, it'll prevent this. --- README.rst | 18 ++++++++++++++---- tabbedalt | 23 +++++++++++++++++------ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 96f8d6b..fc18a79 100644 --- a/README.rst +++ b/README.rst @@ -63,7 +63,6 @@ or even without "installing" at all: $ curl https://raw.githubusercontent.com/gryf/tabbedalt/master/tabbedalt -o /tmp/tabbedalt $ URXVT_PERL_LIB=/tmp urxvt -pe tabbedalt - Configure --------- @@ -120,6 +119,18 @@ You can change those values but bear in mind, that first group should have timeout in seconds set higher, than middle one. You can also change symbols for those groups. +Flickering +~~~~~~~~~~ + +If you happen to see fonts flickering on the terminal, you might want to set +this resource to true:: + + URxvt.tabbedalt.stop-flickering: true + +It is false by default, and it will affect how refreshing of the tabs and +windows is done. I was experienced it mostly on Intel graphics, with bitmap +fonts, but your mileage may vary. + Tab numbers ~~~~~~~~~~~ @@ -147,7 +158,7 @@ There are several actions, which tabbedalt supports: * ``next_tab`` - for jumping to next tab * ``move_tab_left`` - for moving tab to the left * ``move_tab_right`` - for moving tab to the right -* ``jump_to_tab`` - for quickly jumping into first tenth tabs +* ``jump_to_tab`` - for quickly jump into specific tab See next sections for examples. This feature was adapted from `tabbedex`_. @@ -159,7 +170,7 @@ By setting:: URxvt.tabbedalt.disable-default-keys: true you can completely remove default keystrokes for creating and navigating tabs. -In fact, if this resource is set to true (default), than tabbedalt will create +In fact, if this resource is set to false (default), than tabbedalt will create several keysyms mapped to the actions: * ``Shift-Down``: ``new_tab`` - create tab @@ -236,7 +247,6 @@ still a way for selecting 10th tab, i.e.:: In the example above, there are mapping for jump to tabs 1 - 12 using function keys, and `Control+0` to jump whatever last tab is. - Creating custom classes ----------------------- diff --git a/tabbedalt b/tabbedalt index a5cc3af..ffdceb8 100644 --- a/tabbedalt +++ b/tabbedalt @@ -145,6 +145,9 @@ # # 2022-02-23 20:03:33 # - Added jump to last tab feature +# +# 2022-09-18 14:26:00 +# - Add workaround for font flickering use Scalar::Util; @@ -342,12 +345,19 @@ sub configure { my $tab = $self->{cur}; - # this is an extremely dirty way to force a configurenotify, but who cares - $tab->XMoveResizeWindow ( - $tab->parent, - 0, $self->{tabheight} + 1, - $self->width, $self->height - $self->{tabheight} - ); + if (! $self->{stop_flickering}) { + # NOTE: switching between height +1 and height can be annoying, + # especially well seen as flickering of part of the terminal on Intel + # graphics and small fonts. + + # this is an extremely dirty way to force a configurenotify, but who + # cares + $tab->XMoveResizeWindow ( + $tab->parent, + 0, $self->{tabheight} + 1, + $self->width, $self->height - $self->{tabheight} + ); + } $tab->XMoveResizeWindow ( $tab->parent, 0, $self->{tabheight}, @@ -540,6 +550,7 @@ sub init { $self->{set_default_keys} = (! $self->x_resource_boolean('disable-default-keys')); $self->{autohide} = $self->x_resource_boolean('autohide'); $self->{zero_jump_last} = $self->x_resource_boolean('zero-jump-last'); + $self->{stop_flickering} = $self->x_resource_boolean('stop-flickering'); my $timeouts = $self->x_resource ("tabbar-timeouts"); $timeouts = '16:.:8:::4:+' unless defined $timeouts;