* COMMENT -*- mode: org -*- #+Date: 2019-09-02 Time-stamp: <2023-08-01> #+STARTUP: content * notes :entry: ** 2020-06-03 how to make a release? - update version number in meson.build - update ChangeLog in README.org - build deb ./create-deb.sh - test application in a VM. I will test in s01. - build deb for x86 as well. - publish deb to apt repo deb.emacsos.com ** 2020-06-03 how to test dual monitor support - dual display test: when user type in emacs frame in a display, zero-panel should appear in the same display. - some elisp to test dual monitor support in dual 1920x1080 monitor. (zero-input-panel-quit) (zero-input-panel-move 0 0) (zero-input-panel-move 900 0) (zero-input-panel-move 900 500) (zero-input-panel-move 3208 884) (zero-input-panel-show) (zero-input-panel-hide) ** 2020-06-03 how to run with debug log when developing new features? - kill existing zero-panel process (zero-input-panel-quit) - compile program using meson. in emacs, just press F8. - run program: cd build/ G_MESSAGES_DEBUG=all ./zero-panel ** 2023-08-01 how to create themes? - you need to create one ui file, one css file. make sure you have preedit_label, candidate_label, prev_page_label, next_page_label in your .ui file. it is easy to include image in your .ui file, see an example in ./themes/peppa-pig.ui see existing themes in ./themes/ - some color variables supported in gtk css @fg_color @bg_color * later :entry: ** 2022-08-29 config zero-panel to always shown on-top in full screen mode window. - when emacs run in full screen mode. (press f11 on my laptop) zero-panel can't show on top of emacs window. I already have gtk_window_set_keep_above(GTK_WINDOW(appdata->window), TRUE); search: window can't show on top in emacs toggle-frame-fullscreen Gtk.Window.set_keep_above https://docs.gtk.org/gtk3/method.Window.set_keep_above.html try call it once after user toggle full screen in emacs. nope. it didn't work. - search: show window on top of emacs fullscreen mode xfce - How to make new window get the focus when Emacs in full-screen mode in Xfce4? - Unix & Linux Stack Exchange https://unix.stackexchange.com/questions/362427/how-to-make-new-window-get-the-focus-when-emacs-in-full-screen-mode-in-xfce4 search: gtk bring a window on top How to pop up a GTK window/widget on top of a full screen application of a different process in Linux? - Stack Overflow https://stackoverflow.com/questions/50626271/how-to-pop-up-a-gtk-window-widget-on-top-of-a-full-screen-application-of-a-diffe You'll have to integrate B into the window manager somehow, and not make it as a standalone application. search: gtk how to mark a window not a standalone application? gtk_window_set_type_hint(GTK_WINDOW(appdata->window), GDK_WINDOW_TYPE_HINT_DIALOG); all type hints https://docs.gtk.org/gdk3/enum.WindowTypeHint.html GDK_WINDOW_TYPE_HINT_DOCK add pager and taskbar skip hints. // how did my app not shown in taskbar? I didn't put any type hint. // type hint is specified in themes/*.ui file. // I also have True True xprop _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_TOOLTIP tried other type hint. none works. GDK_WINDOW_TYPE_HINT_POPUP_MENU GDK_WINDOW_TYPE_HINT_NOTIFICATION GDK_WINDOW_TYPE_HINT_DOCK - it's not emacs specific. the window also doesn't show up when firefox is in full screen mode. how does ibus/fcitx solve it? check fcitx source code. fcitx/src/ui at master · fcitx/fcitx · GitHub https://github.com/fcitx/fcitx/tree/master/src/ui classic kimpanel // I remember kimpanel. it's a KDE component. src/ui/classic/InputWindow.h src/ui/classic/InputWindow.c This is the Preedit Window for Input #+BEGIN_SRC c void InputWindowShow(InputWindow* inputWindow) { if (!WindowIsVisable(inputWindow->parent.owner->dpy, inputWindow->parent.wId)) InputWindowMoveWindow(&inputWindow->parent); XMapRaised(inputWindow->parent.owner->dpy, inputWindow->parent.wId); FcitxXlibWindowPaint(&inputWindow->parent); } #+END_SRC where is XMapRaised defined? https://www.systutorials.com/docs/linux/man/3-XMapRaised/ man XMapRaised(3) Xlib - C Language X Interface int XMapRaised(Display *display, Window w); how to call this in gtk? search: how to call XMapRaised in gtk? gtk_window_present () gtk_window_present_with_time () try this. I think it should send a map request. /* I can't get panel to show in firefox/emacs full screen mode */ /* gtk_window_present_with_time(GTK_WINDOW(appdata->window), GDK_CURRENT_TIME); */ - I can't find this. maybe fix this when porting to wayland server. - problems - how to get timestamp for gtk_window_present_with_time() call? its type is guint32. https://code.woboq.org/gtk/gtk/gtk/gtkwindow.c.html just use GDK_CURRENT_TIME. it's not working. ** 2019-09-03 bug: panel window should not get focus in GNOME 3 on Wayland. currently panel keeps flashing when typing in this env. it's focus-in focus-out problem. when panel shows up, zero got a focus-out event, which it think user has switched off emacs window, so it send hide() to panel. Now focus is back in emacs, focus-in, zero wants to show the panel again. it's endless recursion. The key problem is zero-panel should not receive focus in GNOME 3 shell. I already set this in ui file: False False They don't work properly in Wayland. - see minimal test application at ~/c/testing-only/do-not-focus/main.c * current :entry: ** ** 2019-09-02 support user configuration of theme and panel orientation. is it supported by zero-el? - 2023-08-01 ~/.config/zero-panel.conf theme=default theme=zero-panel theme=peppa-pig-v horizontal vertical - allow dynamic reload or change theme. is it easy to do? just quit, it will auto restart on next panel activation. add a cli command to quit zero-panel. in emacs I do (zero-input-panel-quit) just also support this in cli. zero-panel -k --kill kill existing zero-panel and exit zero-panel -r --replace kill existing zero-panel and start a new instance (--replace has a similar effect as reload) ** 2019-09-02 remove black bg in round corner. should be transparent. is it because I don't have a compositor that support alpha? - 2023-08-01 search: gtk border-radius round corner has dark background the problem is the compositor. you can try picom. what is KDE's compositor? kwin. kwin supports KDE round corners just fine. * done :entry: ** 2023-08-01 support dark theme better. when using dark theme, default font color is white, I can't read zero-panel candidates. - to support dark theme better - when using a picture as background, ignore theme font color, use my font color. ./themes/peppa-pig-v.ui ./themes/peppa-pig-v.css - when not using a picture as background, use gtk default. - zero-panel default theme works fine in KDE dark theme. ./build/zero-panel - peppa-pig-v theme not working properly. color: black; (zero-input-panel-quit) ./build/zero-panel -t peppa-pig-v nope. add color black didn't work. why? search: gtk text color in dark theme css try set some obvious css style, make sure it is effective. background-color: #000; it works. - maybe in dark-theme, widget doesn't inherit bg color and color from parent. this didn't work: color: #000; background-color: #fff; what if I don't set bg color at all. bg is transparent. font color is white. for this color themed panel, font color should not follow system theme. - try add style on label tag. it works. label works on any GtkLabel widget. - some color variables supported in gtk css @fg_color @bg_color ** 2020-06-03 support dual monitor - bug: 双显示器 zero-panel panel 没有显示到光标位置。而是在另一个屏幕右侧边缘。 而且高度是对的。 - 先看 zero-el 发送给 zero-panel 的坐标是否正确。是否包含 monitor 信息。 然后看 zero-panel 的响应是否正确。 - zero-input-show-candidates (zero-input-get-point-position)(3208 884) 这个没问题。 单块屏幕分辨率是 1920x1080 这个返回的坐标是考虑了显示器相对位置的坐标。 (zero-input-panel-move 3208 884) (zero-input-panel-show) // 这个有问题。move的时候没有考虑多显示器的情况。 check dbus service server side. ~/c/zero-panel/server.c static void move_window(gint x, gint y, AppData *appdata) display = gdk_display_get_default(); monitor = gdk_display_get_monitor_at_window(display, window); this is wrong. we should get the monitor for emacs window, not zero-panel window. we should move the zero-panel window to emacs window's monitor. then move the window to specific position. TODO add test case, dual display test: when user type in emacs frame in a display, zero-panel should appear in the same display. - how to do that? we should get the monitor for emacs window, not zero-panel window. we should move the zero-panel window to emacs window's monitor. then move the window to specific position on that monitor. WONTFIX is there an API to move the window to screen position instead of monitor position? if there is, maybe just use that API instead? still need to consider borders though. - problems - how to get the monitor ID where the emacs frame is running on? pass the monitor ID in hints. check elisp doc. Info: (elisp) Basic Parameters ‘display’ The display on which to open this frame. It should be a string of the form ‘HOST:DPY.SCREEN’, just like the ‘DISPLAY’ environment variable. *Note Multiple Terminals::, for more details about display names. (frame-parameter nil 'display)":0" this is always ":0". it's X server display. not physical display. search: emacs get frame's display number in dual monitor setup (display-monitor-attributes-list) when there are two frames, one on each display, this is the result: #+BEGIN_SRC elisp (((name . "DP-0") (geometry 1920 0 1920 1080) (workarea 1920 0 1920 1080) (mm-size 527 296) (frames #) (source . "Gdk")) ((name . "HDMI-0") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size 531 299) (frames #) (source . "Gdk"))) #+END_SRC when there is only one frame on DP-0 display: (display-monitor-attributes-list) #+BEGIN_SRC elisp (((name . "DP-0") (geometry 1920 0 1920 1080) (workarea 1920 0 1920 1080) (mm-size 527 296) (frames #) (source . "Gdk")) ((name . "HDMI-0") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size 531 299) (frames) (source . "Gdk"))) #+END_SRC 可以根据坐标计算出当前frame在哪个display。 geometry x y width height x y 可以看出display的相对位置。 try use gdk_display_get_monitor_at_point () http://localdocs.emacsos.com/gdk3/GdkDisplay.html#gdk-display-get-monitor-at-point - how to move window to the correct monitor? try just move to the coordinate. correct formula to calculate overflow. #+BEGIN_SRC sh (zero-panel:57769): DEBUG: on_handle_show_candidates() preedit_str=h (zero-panel:57769): DEBUG: show_candidates() (zero-panel:57769): DEBUG: move_window x=2881 y=869 (zero-panel:57769): DEBUG: 2 monitors belong to :0 (zero-panel:57769): DEBUG: screen size: x=1920 y=0 width=1920 height=1080 (zero-panel:57769): DEBUG: window size:width=120 height=284 (zero-panel:57769): DEBUG: set newx=1920-120=1800 (zero-panel:57769): DEBUG: set newy=1080-284=796 #+END_SRC it works. ** 2019-09-02 should I add README in deb file? where to install it to? /usr/share/doc/zero-panel/README - maybe also write a man page. /usr/share/man/man1/zero-panel.1.gz example man page /usr/share/man/man1/python3.5.1.gz /usr/share/man/man1/ls.1.gz generated by help-to-man ** 2019-09-02 issue: can't show panel in GNOME 3 shell - it seems dbus message is resent quite a few times for the same preedit str. is it because I didn't send a response and dbus has auto resend? it's not dbus resend problem. I see the problem. it's focus-in focus-out problem. when panel shows up, zero got a focus-out event, which it think user has switched off emacs window, so it send hide() to panel. Now focus is back in emacs, focus-in, zero wants to show the panel again. it's endless recursion. The key problem is zero-panel should not receive focus in GNOME 3 shell. - search: GNOME 3 shell gtk application how to add hint to not let a window get focus maybe it's running wayland? yes. confirmed only wayland is running, X is not. search: gtk wayland how to set hint so a window doesn't receive focus Using GTK+ with Wayland: GTK+ 3 Reference Manual https://developer.gnome.org/gtk3/stable/gtk-wayland.html GDK_BACKEND=wayland your-app that doesn't help. Initiatives/Wayland/GTK+ - GNOME Wiki! https://wiki.gnome.org/Initiatives/Wayland/GTK%2B search: wayland gtk3 accept-focus focus-on-map False doesn't work search: wayland gtk3 how to create a window that will not get focus 1260773 – [GTK3][Wayland] Child popup gets focus-in, focus-out events https://bugzilla.redhat.com/show_bug.cgi?id=1260773 [Firefox] gdk_device_grab() on popup drags focus from main app window on Wayland/mutter (#837) · Issues · GNOME / gtk · GitLab https://gitlab.gnome.org/GNOME/gtk/issues/837 - MOVED I can't fix this problem now. There is no doc on how to not get focus in wayland when a window is shown. search: how to not get focus in wayland when a window is shown Bug #1826176 “Applications do not receive focus in Wayland sessi...” : Bugs : gnome-shell package : Ubuntu https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1826176 ** 2019-09-02 apply apache license. * wontfix :entry: ** 2023-08-01 try build deb using demake and debuild. I don't like fpm. - is fpm maintained? yes. there are lots of open issues. but the project is still alive. - does fpm support systemd service file? yes. Command-line Reference — fpm - packaging made simple 1.9.0 documentation https://fpm.readthedocs.io/en/latest/cli-reference.html --deb-systemd FILEPATH (deb only) Add FILEPATH as a systemd script --[no-]deb-systemd-auto-start --[no-]deb-systemd-enable so it can still work. - continue using it if it is not broken.