jmc-88 / tint3 Goto Github PK
View Code? Open in Web Editor NEWA C++ rewrite of the tint2 panel
Home Page: https://jmc-88.github.io/tint3/
License: GNU General Public License v2.0
A C++ rewrite of the tint2 panel
Home Page: https://jmc-88.github.io/tint3/
License: GNU General Public License v2.0
When _NET_WM_ICON is set but empty, data is not NULL, but the length is zero. However the code only checks for NULL; GetIconCount() returns correctly zero; but GetBestIcon assumes non-zero length and then performs some small out of bounds accesses. This may set both w and h to negative numbers, in which case this is followed by a large oob read to fill in icon_data.
This can be tested with the program fldigi
, but a script to set an empty _NET_WM_ICON to any window could probably trigger it too.
A quick fix is to add the correct checks. But the problem is that GetIcon/GetIconCount/GetBestIcon contain some really crappy code...
A different issue, a few lines after, is that imlib_create_image_using_copied_data is necessary in i386 too. Since we're about to XFree the buffer afterwards.
The following config results in a core dump with a "floating point exception" error. Commenting out one of the "panel_background_id" and "launcher_item_app" lines makes it work.
Hitting -c on a running tint3 process causes a seg fault.
Is there a way to convert a tint2 config to a tint3 config?
I think this project was a good idea,
hopefully it can reach feature parity with tint2.
Kind Regards
(Managed to send just an empty issue at first...)
Building tint3 on Arch is currently failing.
https://aur.archlinux.org/packages/tint3-cpp-git/
Adding xorg-xauth and curl dependencies didn't fix the issue.
Buildlog
https://gist.github.com/Lartza/bc2e2c0df764333e8bb3bbd1b08c5663
This doesn't seem to affect the original tint2, so it's something gone wrong during the refactorings - git bisect will probably help.
Something like this:
https://code.google.com/p/tint2/issues/detail?id=44
I'm not sure if this is right or not, but I don't think it's nice to remove the names of previous authors and contributors from the AUTHORS file, as some of the old code is still in use. Maybe re-add them and list them as previous authors or something?
The commit was cc633d8
The startup notification code is calling the functions sn_launcher_context_complete() and sn_launcher_context_unref() (also util::log::Error() but not sure about that one) from a signal handler. These functions call in turn other functions from Xlib, which may block.
Calling any potentially blocking function from a signal handler is forbidden, as it may cause a deadlock. Even if a deadlock does not happen, there might be races.
The solution is to only communicate the event from signal handler to the event loop, and run the handling code there. The event loop might be blocking in select() so it needs to be woken up.
This can be achieved by using a non-blocking pipe: the signal handler writes a byte into the pipe, while the event loop selects on both the X11 socket and the pipe.
Reference: http://cr.yp.to/docs/selfpipe.html
Here is a fix: https://gitlab.com/o9000/tint3/commit/d3205e7ab534752ae4a87d2ad9a675ac016f301b
The only thing I'm not sure of is in which file to define SigchldHandler(). src/util/x11.cc might not be the best place.
When I run Qpdfview (0.4.14) immediately after logon, an icon in the system tray - usually that of the NetworkManager applet or Pasystray - gets duplicated and sometimes some graphical junk also appears in the system tray. When I reload Tint3's configuration (killall -SIGUSR1 tint3), or load Qpdfview later in the logon session, everything seems okay. (I also tried with sqlitebrowser - another Qt5 program - and it didn't seem to cause a problem.)
Qpdfview definitely seems the worst culprit, for some reason.
Note: I had occasional problems with Tint2 duplicating icons too, but can't recall any special circumstances or programs involved. Again, reloading Tint2's configuration cleared the problem.
OS: Arch
Kernel: 5.9.9-zen
Tint3: v0.3.0
Bspwm: v0.9.10
Stopped at: WM doesn't respect NETWM specs, tint3 will default to 1 desktop.
Restarted loaded for a while then crashes
Real transparency: on, depth: 32
WM doesn't respect NETWM specs. tint3 will default to 1 desktop.
Segmentation fault (core dumped):
When autostarting with openbox, tray doesn't show and the panel panel turns black when clicking.
Am using fully upgraded Arch Linux with Openbox and the AUR package tint3-cpp-git-r743.7aed132-1-x86_64.pkg.tar.xz (but no compositor being used). Also, I'm using PCManFM to manage desktop icons and background. After a fresh login, tint3's panel looks as normal, but the first time I run a Qt5 program - such as qpdfview or sqlitebrowser (Arch packages) - the panel goes completely black. The tint3 process continues to run, but the only way I get my panel back is to kill the process and re-run tint3. Then when I run a Qt5 program again and again, everything seems as normal.
This effect does not seem to happen with Qt4 programs.
It's a strange problem, I know, but that's the best description I have of it for now!
Hi,
I've tried adding launchers section and changing panel_items to LTSBC in the config file, same as possible with tint2-svn, but it doesn't work. Is there a chance you consider supporting this in the future?
Thanks.
Possibly due to cmake 3.14, although I don't see a breaking change at a glance. Build on Debian sid seems to work on 3.13.
CMake Error at /usr/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find X11 (missing: X11 Xrandr>=1.3)
Call Stack (most recent call first):
/usr/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.14/Modules/FindX11.cmake:366 (find_package_handle_standard_args)
CMakeLists.txt:45 (find_package)
-- Configuring incomplete, errors occurred!
See also "/build/tint3-cpp-git/src/tint3/CMakeFiles/CMakeOutput.log".
Using Xcomposite Xdamage Xfixes Xinerama Xrender Xrandr)
the build succeeds.
Am running tint3 from commit dfb6242 on Asus netbook laptop running Arch Linux 64-bit.
With the following section in tint3rc the battery_low_cmd does not seem to be activated when battery charge falls below 20% (or other setting):
# Battery
battery = 1
battery_low_status = 20
battery_low_cmd = notify-send -u critical "Danger: battery low"
battery_hide = 0
bat1_font = Liberation Sans Bold 9
bat2_font = Liberation Sans 9
battery_font_color = #FFFFFF 100
battery_padding = 1 1
battery_background_id = 1
This definitely worked with tint2-git Arch package a while ago.
Apart from this problem, the battery feature seems to work fine in tint3.
Using package 'tint3-cpp-git-r748.cb79110-1-x86_64.pkg.tar.xz' on an Asus Eee PC 1015PX netbook running fully updated Arch Linux. Have enabled (battery = 1) in tint3rc, but the battery icon and its text are not showing in the system tray. (This netbook uses BAT0.)
I am using tint3 in my ArchLinux box, running under Pekwm 0.17 (from standard repos now). The package I use is tint3-cpp-git from AUR. The first time I compiled tint3-cpp-git I was using Pekwm-git from AUR too, but I have recompiled tint3 after I downgraded to packaged Pekwm (the current pekwm-git on AUR is buggy).
Now tint3 is complaining that "true" is not valid for items that are set to be "boolean" (but "0" and "1" both work as expected).
And, what is more important, the panel doesn't appear if margins are set to "0 0" or width is a percentage. If width is specified as an integer (whatever) it shows, but occupying 100% of screen width. If margins are set greater than 0 for both, the panel appears, but, as expected, windows appear above it.
Here I include my tint3rc
# Default tint3 configuration file.
#
# For information on manually configuring tint3 see:
# https://github.com/jmc-88/tint3
# {{{ backgrounds
# ID 1
rounded = 2
border_width = 0
background_color = #dddddd 80
border_color = #dddddd 0
# ID 2
rounded = 1
border_width = 0
background_color = #efefef 0
background_color_hover = #7f7f7f 40
background_color_pressed = #7f7f7f 70
border_color = #000000 0
# ID 3
rounded = 0
border_width = 0
background_color = #ffcc00 80
border_color = #000000 0
# ID 4
rounded = 0
border_width = 0
background_color = #3f3f3f 90
border_color = #000000 0
# }}} backgrounds
# {{{ panel
panel_monitor = all
panel_position = top left horizontal
panel_size = 26 26
panel_margin = 1 1
panel_padding = 0 0 0
panel_dock = 0
wm_menu = 1
panel_layer = top
panel_background_id = 1
panel_items = LTSC
# }}} panel
# {{{ taskbar
taskbar_mode = multi_desktop
taskbar_padding = 0 0 0
taskbar_background_id = 1
taskbar_active_background_id = 0
# }}} taskbar
# {{{ tasks
urgent_nb_of_blink = 20
task_icon = 1
task_text = 1
task_centered = 0
task_maximum_size = 440 16
task_padding = 0 2 6
task_background_id = 1
task_tooltip = 1
task_active_background_id = 3
task_urgent_background_id = 2
task_active_font_color = #616161
task_font_color = #000000
task_font = tooltip_font = Iosevka Type Slab 9
task_iconified_background_id = 2
# }}} tasks
# {{{ task icons
task_icon_asb = 100 0 0
task_active_icon_asb = 100 0 0
task_urgent_icon_asb = 100 0 0
task_iconified_icon_asb = 100 0 0
# }}} task icons
# {{{ system tray
#systray = 1
systray_padding = 0 2 6
systray_sort = right2left
systray_background_id = 2
systray_icon_size = 16
systray_icon_asb = 100 0 0
# }}} system tray
# {{{ battery
battery = 0
# }}} battery
# {{{ clock
#clock = 1
time1_format = %H:%M
time1_font = Sans 10
clock_font_color = #0f0000
#clock_background = 3
clock_padding = 10
clock_lclick_command = qarma --calendar
# }}} clock
# {{{ tooltips
tooltip = 1
tooltip_padding = 2 2
tooltip_show_timeout = 0.0
tooltip_hide_timeout = 0.0
tooltip_background_id = 2
tooltip_font = Iosevka Type Slab 9
tooltip_font_color = #616161 100
# }}} tooltips
# {{{ mouse
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
mouse_effects = 1
mouse_hover_icon_asb = 100 0 25
mouse_pressed_icon_asb = 100 0 -25
# }}} mouse
# {{{ launchers
launcher_icon_size = 24
launcher_icon_theme = Delft
launcher_tooltip = 1
launcher_item_app = $HOME/.local/share/applications/menu.desktop
# }}} launchers
#
font_shadow = 1
strut_policy = follow_size
I hope this report is constructive to debugging and improving tint3.
Anyway, thank you for writing this software!
When trying to makepkg latest commit b00a82b with AUR tint3-cpp-git PKGBUILD I get the following failure (though it builds fine on a 64-bit system):
http://pastebin.com/3qST1Tsy
Again another build failure on Arch, after a long while.
This is the current failing PKGBUILD and I don't really know what more to try
https://gist.github.com/Lartza/4f91a4995827fdde488fc7cd3beb7bfa
CMakeError.log
CMakeOutput.log
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAS_LIBCXX
-- Performing Test HAS_LIBCXX - Failed
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.5.3")
-- Checking for module 'pangocairo'
-- Found pangocairo, version 1.42.3
-- Checking for module 'pango'
-- Found pango, version 1.42.3
-- Checking for modules 'cairo;cairo-xlib'
-- Found cairo, version 1.15.12
-- Found cairo-xlib, version 1.15.12
-- Checking for module 'glib-2.0'
-- Found glib-2.0, version 2.56.2
-- Checking for module 'gobject-2.0'
-- Found gobject-2.0, version 2.56.2
-- Checking for module 'imlib2>=1.4.2'
-- Found imlib2, version 1.5.1
-- Checking for module 'libxsettings-client'
-- Package 'libxsettings-client', required by 'virtual:world', not found
CMake Error at /usr/share/cmake-3.12/Modules/FindPkgConfig.cmake:436 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.12/Modules/FindPkgConfig.cmake:602 (_pkg_check_modules_internal)
CMakeLists.txt:39 (pkg_check_modules)
-- Configuring incomplete, errors occurred!
See also "/home/lartza/aur/tint3-cpp-git/src/tint3/CMakeFiles/CMakeOutput.log".
See also "/home/lartza/aur/tint3-cpp-git/src/tint3/CMakeFiles/CMakeError.log".
Setting autohide = 1 results in the following output (each repeated several times):
-> Xlib error (3): BadWindow (invalid Window parameter)
Programming error: timeout already deleted
It should accept a path (absolute, or relative to the configuration file being evaluated) to evaluate at that point in the file.
Default values for all configuration attributes should be provided, so that an empty configuration file doesn't result in a crash or in an unusable panel. Right now, if no panel_size is provided, Launcher::GetIconSize()
will return 0 and cause Launcher::Resize()
to abort the program with SIGFPE.
Hi there,
I found a bug in tint2 that might affect tint3 too: it does not ignore disabled video outputs, which are returned by XRRGetCrtcInfo with width and height set to zero according to the randr documentation: https://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt#n1010
A change should be made around this line https://github.com/jmc-88/tint3/blob/master/src/server.cc#L222 to ignore such outputs. Otherwise we'll try to create a panel with size zero for a monitor that doesn't exist, that eventually leads to some strange problems.
Reference: https://gitlab.com/o9000/tint2/issues/618
Hi,
Currently trying to build tint3-cpp-git
from the aur fails:
[ 25%] Building CXX object abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
/home/clu/build/tint3-cpp-git/src/tint3/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::synchronization_internal::GraphCycles::RemoveNode(void*)’:
/home/clu/build/tint3-cpp-git/src/tint3/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: ‘numeric_limits’ is not a member of ‘std’
451 | if (x->version == std::numeric_limits<uint32_t>::max()) {
| ^~~~~~~~~~~~~~
/home/clu/build/tint3-cpp-git/src/tint3/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before ‘>’ token
451 | if (x->version == std::numeric_limits<uint32_t>::max()) {
| ^
/home/clu/build/tint3-cpp-git/src/tint3/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: ‘::max’ has not been declared; did you mean ‘std::max’?
451 | if (x->version == std::numeric_limits<uint32_t>::max()) {
| ^~~
| std::max
In file included from /usr/include/c++/11.1.0/algorithm:62,
from /home/clu/build/tint3-cpp-git/src/tint3/abseil-cpp/absl/synchronization/internal/graphcycles.cc:38:
/usr/include/c++/11.1.0/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
3467 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
make[2]: *** [abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:76: abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2740: abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
I admit this is a bit beyond me to troubleshoot....
Tool tip is shown at the bottom but the panel is at the top
# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # To use this as default tint2 config: save as $HOME/.config/tint2/tint2rc # Background definitions # ID 1 rounded = 0 border_width = 0 background_color = #151515 30 border_color = #4E4242 100 # ID 2 rounded = 0 border_width = 0 background_color = #000000 100 border_color = #FFFFFF 100 # ID 3 rounded = 0 border_width = 2 background_color = #000000 70 border_color = #4173DE 61 # Panel panel_monitor = all panel_position = bottom left horizontal panel_size = 100% 20 panel_margin = 0 0 panel_padding = 4 0 0 panel_dock = 1 wm_menu = 1 panel_layer = top panel_background_id = 1 # Panel Autohide autohide = 0 autohide_show_timeout = 0.0 autohide_hide_timeout = 0.0 autohide_height = 0 strut_policy = none # Taskbar taskbar_mode = single_desktop taskbar_padding = 0 0 0 taskbar_background_id = 2 taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 7 task_icon = 1 task_text = 0 task_centered = 0 task_maximum_size = 25 16 task_padding = 1 1 task_background_id = 0 task_active_background_id = 0 task_urgent_background_id = 0 task_iconified_background_id = 0 # Task Icons task_icon_asb = 70 -20 0 task_active_icon_asb = 100 0 50 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 40 0 -10 # Fonts task_font = Consolas 11 task_font_color = #888888 100 task_active_font_color = #FFFFFF 100 task_urgent_font_color = #FFFFFF 100 task_iconified_font_color = #7B44CF 100 font_shadow = 0 # System Tray systray = 1 systray_padding = 2 2 6 systray_sort = left2right systray_background_id = 0 systray_icon_size = 0 systray_icon_asb = 100 -20 -22 # Clock time1_format = %A %Y-%m-%d %H:%M time1_font = Consolas 14 clock_font_color = #ADA59D 100 clock_padding = 0 0 clock_background_id = 0 # Tooltips tooltip = 1 tooltip_padding = 5 5 tooltip_show_timeout = 0 tooltip_hide_timeout = 0 tooltip_background_id = 3 tooltip_font = Consolas 15 tooltip_font_color = #ADA59D 100 # End of config
battery applet can't find power_supply
.
How can I fix this?
$ tint3
Real transparency: off, depth: 24
terminate called after throwing an instance of 'std::invalid_argument'
what(): stol
Aborted (core dumped)
Shouldnt happen.
==39769== Process terminating with default action of signal 6 (SIGABRT)
==39769== at 0x7E608D7: raise (in /lib64/libc-2.22.so)
==39769== by 0x7E61CA9: abort (in /lib64/libc-2.22.so)
==39769== by 0x740B2E4: __gnu_cxx::__verbose_terminate_handler() (in /usr/lib64/libstdc++.so.6.0.24)
==39769== by 0x74090D5: ??? (in /usr/lib64/libstdc++.so.6.0.24)
==39769== by 0x7409120: std::terminate() (in /usr/lib64/libstdc++.so.6.0.24)
==39769== by 0x7409362: __cxa_throw (in /usr/lib64/libstdc++.so.6.0.24)
==39769== by 0x7431C2E: std::__throw_invalid_argument(char const*) (in /usr/lib64/libstdc++.so.6.0.24)
==39769== by 0x51CC5D: long __gnu_cxx::__stoa<long, long, char, int>(long (*)(char const*, char**, int), char const*, char const*, unsigned long*, int) (in /opt/wm/bin/tint3)
==39769== by 0x51BC79: std::stol(std::string const&, unsigned long*, int) (in /opt/wm/bin/tint3)
==39769== by 0x517C65: config::Reader::AddEntry_Panel(std::string const&, std::string const&) (in /opt/wm/bin/tint3)
==39769== by 0x516AEA: config::Reader::AddEntry(std::string const&, std::string const&) (in /opt/wm/bin/tint3)
==39769== by 0x515D8E: config::Parser::AddKeyValue(std::string, std::string) (in /opt/wm/bin/tint3)
Design the client tools that will interact with the repository (i.e., should tint3 itself handle this, or should an external "package manager" do the heavy work?).
Still getting these:
-> Xlib error (4): BadPixmap (invalid Pixmap parameter)
-> Xlib error (4): BadPixmap (invalid Pixmap parameter)
-> Xlib error (4): BadPixmap (invalid Pixmap parameter)
-> Xlib error (4): BadPixmap (invalid Pixmap parameter)
-> Xlib error (4): BadPixmap (invalid Pixmap parameter)
-> Xlib error (4): BadPixmap (invalid Pixmap parameter)
-> Xlib error (4): BadPixmap (invalid Pixmap parameter)
It's a developer-only message. User has no clue what to do about it.
Should he be concerned or not??? etc. Where to start?
The problem is that there are multiple places in the code where XSync and XFlush are called. They might read any incoming events from the X11 socket into the Xlib buffer. As a result, calling select() on the X11 socket in the event loop does not detect these events and blocks until either a timeout occurs or a new event is generated by the server. Only then the previous events are processed.
This is sometimes visible at startup, when a system tray icon fails to be rendered for a few seconds.
Here is a solution: https://gitlab.com/o9000/tint3/commit/d417d164e1cca98c6421722092f5132f2910480e
You may import it with:
git remote add o9000 https://gitlab.com/o9000/tint3.git
git fetch o9000
git log o9000/master
git cherry-pick d417d16
Hi
I would like to be able to show/hide tint3 with a key and I'd also like to have it popup when there is a bell or urgent/new window on another workspace. Something like i3bar does in i3wm.
I'm using fluxboix. Is any of this possible?
Steps to reproduce:
tint3 -c configfile
killall tint3
tint3 -c configfile
Doesn't occur when I autostart tint3 with openbox, kill the bugged bar (see issue below) and start a new one. Upon killing the new bar, this will occur.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.