1
0
Fork 0
mirror of https://github.com/Cloudef/bemenu synced 2024-05-21 06:56:09 +02:00
Commit Graph

91 Commits

Author SHA1 Message Date
Joan Bruguera 8217ae024b Fix exiting when an unexpected Wayland error occurs.
If an unexpected error was returned from a Wayland API during rendering (e.g.
from wl_display_flush), the code did set input.sym = XKB_KEY_Escape, so that
the next call to poll_key would return BM_KEY_ESCAPE and bemenu would quit.

However, this has been broken since #135, because input.key_pending was not
set, so the "fake" XKB_KEY_Escape is just ignored, bemenu doesn't quit, but
instead, it enters an infinite loop and keeps a CPU core at 100% usage.

The "quick fix" would be to just set input.key_pending wherever input.sym was
set to XKB_KEY_Escape. However, to make error handling less error-prone,
decouple it from input handling and add an error flag to (bm_menu_)render.
2022-08-03 08:55:34 +09:00
Stacy Harper 3fc0f8a7b7 Revert "Fix pointer enter event without further motion"
This reverts commit ef1055ecce.
2022-07-11 12:14:02 +09:00
Stacy Harper 14e11e8a35 Trigger pointer selection on button release instead
This allow successive bemenu to not register the same PRESSED
successive events.
2022-07-08 18:59:20 +09:00
Daniel Lublin 4c6592ac60 Don't alternate colors by default (let ALTERNATE color be same as ITEM) 2022-07-06 17:10:36 +09:00
Daniel Lublin c04a3c7220 Add options to set cursor bg/fg color 2022-07-05 10:10:26 +09:00
Joan Bruguera ef1055ecce Fix pointer enter event without further motion
If the pointer suddenly enters a window but moves no further, we may only get
a POINTER_EVENT_ENTER but no further POINTER_EVENT_MOTION events, so we also
need to handle this event to properly update the selected item.

The issue can be reproduced by moving the mouse programatically, e.g. on Sway:
    swaymsg seat - cursor set 200 200
2022-07-05 10:06:57 +09:00
Joan Bruguera 6e74133876 Fix first render on Wayland after loading items with --grab
Currently, on the Wayland backend, the following command:
    { echo one; sleep 1; echo two; } | BEMENU_BACKEND=wayland bemenu --grab
Will keep showing the 'Loading...' text even after all items are available.
The items will only be shown after some input, e.g. a key press, happens.

This was a regression introduced by 5a095705d2
(versions 0.6.5+). A dirty flag was added to avoid unnecessary redraws,
however, this flag is not reset between the renders before/after the items are
loaded, so the bm_menu_render call after the items are loaded is ignored
(on Wayland, which is the only renderer that currently uses the dirty flag).

Fix the issue by setting the dirty flag when the filter changes, so it will be
reset when changing from "Loading..." to empty and cause a redraw.
2022-06-30 09:40:08 +09:00
Barbaross 8c1c29c0b9 Add option to define a border and border color 2022-06-29 15:13:09 +09:00
Barbaross 84bccc02a0 Add option to specify horizontal padding in single line mode 2022-06-03 09:20:10 +09:00
Barbaross a8ef2457cb Add option to specify alternating entry background/foreground colors 2022-06-03 08:08:38 +09:00
Barbaross 9a76681b2c Add option to specify cursor width 2022-06-03 08:08:21 +09:00
Jari Vetoniemi d201c48421 get rid of all the internal symbols 2022-02-19 08:00:26 +09:00
Jari Vetoniemi c13e28f4b5 menu: make all run functions part of public API
also remove the unused unicode arguments
2022-02-19 07:41:23 +09:00
Stacy Harper 76b3c25014 Avoid by zero divisions 2022-02-08 22:23:02 +09:00
Stacy Harper 5a095705d2 Optimize redrawing
We add a dirty flag on the menu to track if the menu actually need a
redraw. With it, we will not redraw if the touch is hold on the same
entry by example.
2022-02-08 22:23:02 +09:00
Stacy Harper 9b8da12467 Add a feedback for touchscreen support
The idea is to write "Scroll up…", "Scroll down…" when the finger
touching bemenu will trigger a page scroll on release.
2022-02-08 22:23:02 +09:00
Stacy Harper a111aa2afa mouse and touch support on wayland 2022-02-08 22:23:02 +09:00
Maxim Karasev 43255bbbe8 Add relative width option
It works on Wayland and X11 and acts as a complement to margin. Exact
behavior is as follows:
- If width factor is 0, width minus margin is used.
- If width multiplied by factor is greater than width minus margin,
  width minus is used. (so margin may be used to make sure that bemenu
  is at least N pixels away from the view border)
- Otherwise width multiplied by factor is used.

I think it's fine to disable warnings about floating point numbers
comparision. We don't do any arithmetics on them anyway, so we can't
suffer from inaccuracy.
2021-12-29 17:22:10 +09:00
Andrei E d593ab27b6 Close clipboard file 2021-11-04 09:01:29 +09:00
Andrei E e1a016b8a0 Adapt code style 2021-11-04 09:01:29 +09:00
Andrei E 00efc974d7 Add paste functionality 2021-11-04 09:01:29 +09:00
lunacb 21ff4e47da fixed indentation 2021-11-03 17:57:18 +09:00
lunacb a96ed87472 redesigned vertical alignment
single enum determines if the menu is at the top, in the center,
or at the bottom. implemented in wayland and x11 renderers.
2021-11-03 17:57:18 +09:00
lunacb bddeea05b6 created margin option
-M or --margin option sets the horizontal margin of the window
2021-11-03 17:57:18 +09:00
Stacy Harper 9b2a2cabf2 Add -s to disable title spacing on entries 2021-10-07 00:25:20 +09:00
Ben Brown 0589962d1c Add option to configure cursor height
If set to 0 (the default), the height of the cursor is set to the
height of the line (as is the current behaviour).
2021-08-27 04:01:13 +09:00
Stacy Harper a42fa97a49 add -c center mode on wayland 2021-08-16 17:46:57 +09:00
Sören Tempel 2e922503e8 x11: Align -m argument interpretation with dmenu
With dmenu, monitor indices start at 0 and a value of -1 (the default)
is used to spawn dmenu on the current monitor. While bemenu strives to
be compatible with dmenu, bemenu monitor indices previously started at 1
and a value of 0 (the default) was used to spawn on the current monitor.

This commit aligns the behaviour of bemenu's x11 backend with dmenu. For
this purposes, the affected code in the x11 backend is synced with the
current dmenu implementation. While doing so the monitor type has also
been switched from a uint32_t to a int32_t.
2021-04-27 14:24:02 +09:00
Harley Swick e74224a406 Use -m option for setting monitor name and monitor + cleanup 2021-02-05 16:53:43 +09:00
Robert Günzler 52547807b0
support hiding filter input (#150)
* support hiding filter input

"password mode"

Signed-off-by: Robert Günzler <r@gnzler.io>
2021-02-05 13:12:48 +09:00
Peter Colberg 1dfa72b8bc Fix missing definition for bm_menu_add_item_at
The function was declared in bemenu.h but defined using a different name.
2020-12-13 17:10:41 +09:00
Dominic Monroe 64c38dde50 Add custom key support 2020-08-28 21:01:22 +09:00
Tuomas Siipola bdfc2aac84 menu: fix delete on multi-byte characters 2020-04-19 15:16:14 +03:00
Bill Doyle 6350a4000d
Add transparency support (#96)
Add transparency support
2020-03-16 11:41:42 +09:00
Jari Vetoniemi 56231f8119 bemenu-run: add --fork option
Make terminal backends not fork by default.
Use this option to fork again on curses.
For non terminal backends this option is no-op.
2020-02-08 13:21:36 +02:00
Jari Vetoniemi b688425bf3 menu: fix custom selection 2020-02-08 12:48:15 +02:00
Jari Vetoniemi bc584cc5f0 menu: make SHIFT_RETURN handling more elegant
Don't handle this on client side. Instead have a filter item and return
it if filter text is requested.
2020-02-07 21:54:13 +02:00
Jari Vetoniemi 4534cc8c73 menu: whitespace 2020-02-07 21:53:56 +02:00
Jari Vetoniemi fcce2e019a menu: left/right now moves always cursor
Use SHIFT + left/right to move selection
2020-02-07 18:28:48 +02:00
Jari Vetoniemi 5a4d364d50 Nuke CMake from existance
Welcome glorious GNU Makefile
2020-02-07 16:03:08 +02:00
Jari Vetoniemi 7170c93f3a menu: reset cursor at end on set_filter 2020-02-03 17:43:46 +09:00
Jari Vetoniemi 1607215d70 Extra whitespace 2020-02-03 17:26:17 +09:00
Jari Vetoniemi fedb1b0ab0 Use monospace 10 instead of fixed 9 by default
Matches the dmenu default, monospace instead of font name is more
robust.
2019-12-19 16:58:59 +02:00
Alyssa Ross 93cde4831b
bemenu: add --line-height / -H option
Text is displayed vertically centered in a line. If unspecified, or 0,
the previous behaviour of making the height the size of the text, plus
two pixels on either side, is used, so there will be no change in
behaviour if this option is not used.

Fixes https://github.com/Cloudef/bemenu/issues/44.
2019-05-31 23:20:54 +00:00
Ilia Bozhinov 38069992ec Add option to respect panel position (#48)
* implement option to make menu respect panel boundaries

* fixup! implement option to make menu respect panel boundaries
2019-03-25 23:21:17 +02:00
Jari Vetoniemi f1019bb500 Set default font to Fixed 2017-02-14 19:20:44 +02:00
Jari Vetoniemi eb46ba7bdc Remove bg color option as you never see the real bg anyways. 2015-01-20 18:42:29 +02:00
Jari Vetoniemi c2eabf2be1 Make scrollbar autohideable 2015-01-18 02:07:30 +02:00
Jari Vetoniemi f2eaf599f6 Change default scrollbar style and make colors configurable 2015-01-18 01:38:25 +02:00
Jari Vetoniemi 9c541d0b42 Add --scrollbar option 2015-01-18 01:08:10 +02:00