feh icon indicating copy to clipboard operation
feh copied to clipboard

multiwindow with stdin (feature)

Open RalfWerner opened this issue 3 years ago • 0 comments

@derf could you please set the Label: feature or reject it? I use feh with Termux on Android devices (phones). Because the screen is small, typically without Window Manager (WM). This corresponds to the option -x (also with active WM) and without a mouse because I usually only have my fingers. Preferably also without On-screen-keyboard that claims a large proportion of the screen.

Since the XServer works in its own app/screen, switch between this and the terminal or to split the screen needet, which reduces it even further. Alternatively, a PC terminal is possible if an SSH connection to the phone is made from there. Here shots of two of my devices in portrait and termux-float and landscape and split position of the phones.

The stdin control of feh is awesome! I could do without the on-screen-keyboard and also Extra keys in the XServer may not be necessary. I didn't understand why it shouldn't work with the options -w. In main.c there is the comment: "we aren't running in multiwindow mode (cause it's not clear which window commands should be applied to in that case)"

In this case, the feh control functions are unfortunately not sufficient or I have not discovered them. The following function I miss in your sources:

  • To change the size and position of the windows. XMoveResizeWindow and XResizeWindow exist, but not in events.c. With up/down plus w (possible to repeat) resize is possible but not move and the resize-algorithm is strange.
  • To change the level of overlapped windows. The calls of XMapRaised and XLowerWindow are not found in any source and XRaiseWindow only in menu.c.
  • The missing mouse if there is no OTG/BT connection or the device is missing. The MB2/MB3 actions are no longer possible if the XServer does not emulate them like VNC with disadvantages. But I prefer to work with other (real) Xservers

Solutions

to fix some of the problems with simple changes:

  • To use stdin with option -w, you only need to remove && !opt.multiwindow in main.c. To solve "which window commands should be applied" only the n/p (and alternatives) should work as without -w
  • Solutions for the missing mouse. Possible but not very helpful are MB-emulations by the XServers as with XVNC/XSDL. They change the entire X11 behavior and sometimes lead to general additional effort. MultiTouch events (generic) would also be possible, which requires a major change in your source with -lXi and many new questions are raised. Except for the X11 app (Direct Mode), this is not supported by anyone known to me.
  • Another alternative are Extra-keys in the Java code of the app, which would have to be supplemented and are currently being removed from the development. For this reason, I myself work on an XLIB solution that can be integrated into existing sources such as feh with a header file EK_X5.h (in progress and offtopic here).

windows

in keyboards.c is currently a call with [0] in feh_event_handle_generic. When you replace it with [wn] it can be encoded:

static int wn=0; char z=stdin_buf[0]; int i=(z=='n'||z==' '||z=='C')?1:(z=='p'||z==8||z=='D')?-1:0;
i=(abs(i)!=1)?wn:(wn-i<0)?window_num-1:(wn-i>=window_num)?0:wn-i; /* i is the next/last/same (wn=i) */
winwidget winwid=winwidget_get_from_window(windows[wn]->win); /* possibly needet to raise/move wn */

The p/n funktions with the alternatives right/left and space/backspace are ineffective in both cases ( *handle_stdin and *handle_keypress). They could be used for move the window at use of option -w.

RalfWerner avatar Sep 09 '22 10:09 RalfWerner