mirror of
				https://github.com/termux/termux-packages.git
				synced 2025-10-31 15:45:58 +00:00 
			
		
		
		
	- Fixes https://github.com/termux/termux-packages/issues/25426 How to launch IceWM in Termux:X11: ```bash pkg upgrade pkg install x11-repo pkg install termux-x11-nightly icewm xdg-menu xdg_menu --format icewm \ --fullmenu \ --root-menu \ $PREFIX/etc/xdg/menus/termux-applications.menu \ > ~/.icewm/programs export DISPLAY=:0 TERMUX_X11_XSTARTUP=icewm-session termux-x11 & ``` I was on the fence about whether or not to add `xdg_menu` commands to `postinst` scripts of window managers that don't generate their own menus by default, but I decided not to, because originally, the idea was that users of IceWM, Openbox, Fluxbox and others are supposed to have control over their own configuration files and choose their own way to set up their menu, and learn how to manually run a menu autogenerator, I just personally found the Arch Linux branch of the `xdg_menu` generator to be the easiest to port to Termux and generate a good applications menu for IceWM.
		
			
				
	
	
		
			35 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| The `android_mblen()` implementation copied from the `imlib2` Termux package
 | |
| 
 | |
| --- a/src/ypaint.cc
 | |
| +++ b/src/ypaint.cc
 | |
| @@ -18,6 +18,11 @@
 | |
|  
 | |
|  #ifdef CONFIG_I18N
 | |
|  #include <wctype.h>
 | |
| +
 | |
| +static int android_mblen(const char *s, size_t n)
 | |
| +{
 | |
| +    return mbtowc(0, s, n);
 | |
| +}
 | |
|  #endif
 | |
|  
 | |
|  static inline Display* display()  { return xapp->display(); }
 | |
| @@ -310,7 +315,7 @@ void Graphics::drawCharUnderline(int x, int y, const char *str, int charPos) {
 | |
|      int c = 0, cp = 0;
 | |
|  
 | |
|  #ifdef CONFIG_I18N
 | |
| -    if (multiByte) mblen(nullptr, 0);
 | |
| +    if (multiByte) android_mblen(nullptr, 0);
 | |
|  #endif
 | |
|      while (c <= len && cp <= charPos + 1) {
 | |
|          if (charPos == cp) {
 | |
| @@ -325,7 +330,7 @@ void Graphics::drawCharUnderline(int x, int y, const char *str, int charPos) {
 | |
|              break;
 | |
|  #ifdef CONFIG_I18N
 | |
|          if (multiByte) {
 | |
| -            int nc = mblen(str + c, size_t(len - c));
 | |
| +            int nc = android_mblen(str + c, size_t(len - c));
 | |
|              if (nc < 1) { // bad things
 | |
|                  c++;
 | |
|                  cp++;
 |