mirror of
https://github.com/gryf/tabbedalt.git
synced 2026-08-31 18:17:43 +02:00
Compare commits
2
Commits
1c3555956b
...
6ea8e56fae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ea8e56fae | ||
|
|
5cbd393022 |
@@ -178,6 +178,17 @@
|
|||||||
# - call configure() every time on refresh
|
# - call configure() every time on refresh
|
||||||
# - removed throttling to suppress tab property notifications, as they need to
|
# - removed throttling to suppress tab property notifications, as they need to
|
||||||
# be applied as every call there is different atom to process.
|
# be applied as every call there is different atom to process.
|
||||||
|
#
|
||||||
|
# 2026-08-11 18:42:45
|
||||||
|
# - removed call copy_properties() call from refresh() to avoid unnecessary
|
||||||
|
# Xlib interaction (to spare memory as the consequence) and rely only on
|
||||||
|
# notifications.
|
||||||
|
# - removed call for configure() from places, which will call refresh() as in
|
||||||
|
# refresh() configure will be called anyway.
|
||||||
|
#
|
||||||
|
# 2026-08-12 20:40:54
|
||||||
|
# - narrow down X properties which will be updated during tab_property_notify,
|
||||||
|
# which should slightly improve memory consumption.
|
||||||
|
|
||||||
use Scalar::Util;
|
use Scalar::Util;
|
||||||
|
|
||||||
@@ -293,10 +304,6 @@ sub refresh {
|
|||||||
|
|
||||||
$self->configure;
|
$self->configure;
|
||||||
|
|
||||||
if ($old_tabheight != $self->{tabheight}) {
|
|
||||||
$self->copy_properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $ncol = $self->ncol;
|
my $ncol = $self->ncol;
|
||||||
|
|
||||||
my $text = " " x $ncol;
|
my $text = " " x $ncol;
|
||||||
@@ -480,7 +487,6 @@ sub make_current {
|
|||||||
$self->{cur} = $tab;
|
$self->{cur} = $tab;
|
||||||
$tab->enable_activity_hook(0);
|
$tab->enable_activity_hook(0);
|
||||||
|
|
||||||
$self->configure;
|
|
||||||
$self->copy_properties;
|
$self->copy_properties;
|
||||||
|
|
||||||
$tab->focus_out; # just in case, should be a nop
|
$tab->focus_out; # just in case, should be a nop
|
||||||
@@ -679,7 +685,6 @@ _on start => sub {
|
|||||||
_on configure_notify => sub {
|
_on configure_notify => sub {
|
||||||
my ($self, $event) = @_;
|
my ($self, $event) = @_;
|
||||||
|
|
||||||
$self->configure;
|
|
||||||
$self->refresh;
|
$self->refresh;
|
||||||
|
|
||||||
()
|
()
|
||||||
@@ -821,8 +826,11 @@ sub tab_property_notify {
|
|||||||
return () unless $event->{window} == $tab->parent;
|
return () unless $event->{window} == $tab->parent;
|
||||||
return () unless $tab == $self->{cur};
|
return () unless $tab == $self->{cur};
|
||||||
|
|
||||||
# update only the changed property instead of all properties
|
# update only the changed selected property instead of all properties
|
||||||
my $atom = $event->{atom};
|
my $atom = $event->{atom};
|
||||||
|
my %allowed = map { $_ => 1 } qw(WM_NORMAL_HINTS _NET_WM_NAME WM_NAME);
|
||||||
|
return () unless ($allowed{$self->XGetAtomName($atom)});
|
||||||
|
|
||||||
my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom);
|
my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom);
|
||||||
|
|
||||||
my $wm_normal_hints = $self->XInternAtom ("WM_NORMAL_HINTS");
|
my $wm_normal_hints = $self->XInternAtom ("WM_NORMAL_HINTS");
|
||||||
@@ -838,6 +846,7 @@ sub tab_property_notify {
|
|||||||
$self->{current_properties}{$atom} = [$type, $format, $items];
|
$self->{current_properties}{$atom} = [$type, $format, $items];
|
||||||
|
|
||||||
# free memory from X properties
|
# free memory from X properties
|
||||||
|
undef $wm_normal_hints;
|
||||||
undef $type;
|
undef $type;
|
||||||
undef $format;
|
undef $format;
|
||||||
undef $items;
|
undef $items;
|
||||||
|
|||||||
Reference in New Issue
Block a user