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

Add background_image #2326

Merged
merged 5 commits into from
Jan 31, 2020
Merged

Add background_image #2326

merged 5 commits into from
Jan 31, 2020

Conversation

ctrlcctrlv
Copy link
Contributor

This PR closes #163, and builds off my prior work in #2311 and 8020657, and also work by @kovidgoyal to correct my mistakes, which made this possible.

This PR has been tested both on Nvidia's proprietary OpenGL driver, and Mesa, both on Arch Linux. Sorry, I have no ability to test on OS X, (which is also an impediment to my work on FontForge, but my friends there test it for me,) but think it should work.

@kovidgoyal asked if I enjoyed the journey. I really did! Never did anything with OpenGL before this. It perhaps folly to take this on as my first OpenGL project, but hopefully users enjoy the result of much trial and error.

Scaled examples

2020-01-30-171704_2434x1856_scrot
2020-01-30-171915_2434x1856_scrot
2020-01-30-172148_2434x1856_scrot

Tiling examples

2020-01-30-162821_2434x1640_scrot
2020-01-30-140514_2420x1640_scrot
2020-01-30-135746_2420x1640_scrot

@ctrlcctrlv
Copy link
Contributor Author

Sorry @kovidgoyal, I don't really understand how the Python test framework is supposed to work, it seems that by changing the available options I broke something, perhaps I failed to properly declare it in Python

@kovidgoyal
Copy link
Owner

Dont worry about it I will fix it when I merge.

@kovidgoyal
Copy link
Owner

FYI, I'll be reviewing (and probably merging) this over the next few days.

@ctrlcctrlv
Copy link
Contributor Author

Thank you :-) I will in that case not make any more commits to the branch until your first review, to give you a stable base to review.

@kovidgoyal kovidgoyal merged commit 8a6b8b4 into kovidgoyal:master Jan 31, 2020
@kovidgoyal
Copy link
Owner

I have merged, with various fixes, please test to see that I have not broken anything. And if you have questions about my changes feel free to ask.

@kovidgoyal
Copy link
Owner

@Luflosi I'd appreciate if you could test that background iamges work on macOS since I dont currently have access to my mac.

@Luflosi
Copy link
Contributor

Luflosi commented Jan 31, 2020

Will do during the weekend.

@Luflosi
Copy link
Contributor

Luflosi commented Feb 15, 2020

Sorry for the delay but I finally tested it and it works mostly as expected:
screenshot
Making this work with more image formats would be nice. What would be needed to make this work with JPEG images?
I noticed that part of the tab bar (in the not active tab) is transparent. I guess this is not intended and should probably be fixed. The right of the tab bar, where there are no tabs is currently filled with the background color. It may be desirable to show the background image there.
I also tested transparency and it works as expected.
When I tested with background_tint 0.95, I noticed one pixel wide strips on the right and bottom where the background_tint is not applied. I know that the tint is not applied to the margin/borders but I expected to have no margins since my window size is defined with cells:
initial_window_width 80c and initial_window_height 28c.
screenshot
Here the same screenshot again with hide_window_decorations yes:
screenshot

There must be an off-by-one error somewhere, either in the window size calculation or in the calculation for the tint. How can I help to debug this?

@ctrlcctrlv
Copy link
Contributor Author

It might also be due to the blank rectangles Kitty draws for borders, in anticipation of having multiple visible Kitty windows in an OS window.

In re JPEG, it's not that much work to support, but would require a new dependency. That might not be a problem, libjpeg is extremely common, but I figured it better to keep the code simpler by choosing one image format which implements everything supported by Kitty (alpha).

@kovidgoyal
Copy link
Owner

kovidgoyal commented Feb 16, 2020 via email

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.

background image
3 participants