Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update st to latest upstream #11

Open
wants to merge 135 commits into
base: wayland
Choose a base branch
from

Conversation

ianbeyst
Copy link

I spent the past few days hacking around a bit to update your wayland version to the latest upstream st version (and also stable xdg-shell). For me it was mostly an educational project (I'm not very experienced with C) and I might have broken a thing or two, but I couldn't find any regressions and it seems to work fine.
The st.c file is mostly identical to upstream st and it uses the exact same "API" to talk to wl.c as the X version uses to talk to x.c, except for two function calls in st.c to set the "needdraw" variable in wl.c, these should also be avoided and be moved into wl.c. I'm also not at all happy about the naming of the "API" and general tidyness of the code but nothing insurmountable. In short, it still needs some work but it's a start.

I put up the pull request in the state it is because I won't have much time in the short term to work on this anymore, but maybe it's interesting or useful to you or suckless.

michaelforney and others added 30 commits December 21, 2016 10:38
CTRL+SHIFT is an impossible combination in the terminal world
(0x20 | x & 0x1F), so it is perfect to be used for internals
shortcuts of terminals, and being a double combination
reduces the prossibility of having comflicts.
This is used by, e.g., tmux.
st currently does not keep any mode for the cursor that was active
in the underlying glyph (e.g. italic text), the mode is always
ATTR_NULL [1].  At [2] you can find a screenshot that shows the
implications.  Other terminals (at least vte-based, such as
XFCE-terminal) keep some modes for the cursor.  I find the current
behaviour very disruptive, so here is a patch that keeps a few
(arbitrarily chosen) modes for the cursor.

[1] http://git.suckless.org/st/tree/st.c#n3963
[2] http://i.imgur.com/R2yCEaC.png
Thanks to tarug0 for the suggestion/patch.
Attached.

===> 2/ (text/x-patch) [file]
	cp /mail/fs/mbox/298/2/body /usr/k0ga/0001-st.1-modify-man-page-to-accurately-reflect-default-k.patch

From 265db94b1eca5850d484f86b7db4af8e57822cfe Mon Sep 17 00:00:00 2001
From: Greg Reagle <[email protected]>
Date: Sun, 9 Apr 2017 23:05:47 -0400
Subject: [PATCH] st.1: modify man page to accurately reflect default
 keybindings
Change some styling too while we're at it.
This reverts commit 6cb6d61.
This wasn't a useful thing after all.
This reverts commit 77c51c5.

Having multiple clipboards are useful, for example for plumber scripts.
I've discussed this on IRC and it is useful to have.
This reverts commit 7f99032.

this was wrong as pointed out by k0ga:
"STLDFLAGS is about flags to the linker, for example -L
not about -l for that reason it must go before the object list".
Non-printable characters, such as line breaks, in a base64 encoded
string violate the "string length must be a multiple of four" rule.

This patch pads the result buffer by one extra unit of four bytes,
and skips over non-printable characters found in the input string.
This reverts commit 274d46a.

Sorry, the original commit was correct after all. It allows has the
correct link order and supports static-linking also.

Just a reminder: it is important to give a (brief) rationale of the
patch intentions.
Signed-off-by: Paride Legovini <[email protected]>
An example where the new behaviour makes more sense:

Suppose some text is formatted with ATTR_FAINT for red for the foreground, so it
is rendered in a dark red. In that case, when selected with the mouse, the
intended behaviour is that foreground and background color are swapped: so the
selection should be rendered in dark red and the text in the default background
color.

Before this patch, what happened was that the selection would be in normal red
and the text in the darkened background color, making it almost unreadable.

For an example application that uses the FAINT attribute, try dmesg from
util-linux with color support, it uses FAINT for segfault messages.
The alpha value needs to be initialized as well.
config.h includes references to KeySyms and other X stuff.  Until we
come up with a cleaner way to separate configuration, it is simpler
(leads to more code removal) to have this here.

Signed-off-by: Devin J. Pohly <[email protected]>
No need to keep a function that only calls another function in the same
file.

Signed-off-by: Devin J. Pohly <[email protected]>
These were only used in x.c, which now has direct visibility of the
config.h arrays.

Signed-off-by: Devin J. Pohly <[email protected]>
This makes xsetenv internal to x.c, and allows iso14755's external
command to use $WINDOWID instead of having to snprintf it again.  (The
same benefit will apply to the externalpipe patch.)  The xwinid function
is no longer needed.

Signed-off-by: Devin J. Pohly <[email protected]>
avih and others added 28 commits April 14, 2019 13:50
This has been asked many times on IRC and the mailinglist. Make it easier to
find information about this particular Xft issue by adding it to the FAQ.
Also fix shell return value detection.
st is now usable on velox/swc. Before, it gave a segfault on startup.
To prevent contaminating the already existing x11 st on my system.
crude first steps to move the wayland stack to a state where it becomes
easy to track upstream st. Most wayland related functions are separated
out and the program compiles and runs. Further work is needed to flesh
out bugs, clean up the messy code and eventually merge with upstream.
A lot of functions called in st.c were prepended by "wl" to
differentiate them from their "x" counterparts, eg xclipcopy ->
wlclipcopy. These are all renamed to be prepended with "x" to ease
merging. In the future, st should move to neutral terminology here.
…ugfixes

There was an issue where the surface never gets drawn if xstartdraw
returns the window visibility mode that was temporarily fixed by always
returning 1. This has been fixed by simply initializing win.mode to
MODE_VISIBLE. Also removed the useless wl.vis attribute.
@michaelforney
Copy link
Owner

Thanks a lot for doing this! I will take a look when I find some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.