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

Opening an Image flashes it fullscreen first and then resizes it to fit #120

Closed
charbelnicolas opened this issue Mar 22, 2024 · 8 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@charbelnicolas
Copy link

I'm trying to migrate away from feh and I've noticed some quirks when using swayimg. When opening images with feh they appear correctly sized and there are no visible issues with it but when opening the same image with swayimg they always flash in full size and then resize to fit to the screen or so it seems. Please see the attached video:

vid_2024_03_22_12_50_10.mp4

It would be nice if images where correctly sized to fit on open and we didn't see them flash full screen first.

@artemsen
Copy link
Owner

Looks like a bug, but I can't reproduce it.

@artemsen artemsen self-assigned this Mar 22, 2024
@charbelnicolas
Copy link
Author

It must be a configuration issue then... I'll post my swayimgrc when I get back home.

@charbelnicolas
Copy link
Author

I found the culprit:

# Window size (parent, image, or absolute size, e.g. 800,600)
size = parent

If I change it to size = 1920,1080 I don't see any glitches.

It must be setting the window size to something bigger than the display output resolution at startup....

Anyways, here is my config:

# Swayimg configuration file.

# This file contains the default configuration.
# The viewer searches for the config file in the following locations:
# 1. $XDG_CONFIG_HOME/swayimg/config
# 2. $HOME/.config/swayimg/config
# 3. $XDG_CONFIG_DIRS/swayimg/config
# 4. /etc/xdg/swayimg/config

# See `man swayimgrc` for details.

################################################################################
# General options
################################################################################

[general]

# Initial scale (optimal/fit/width/height/fill/real)
scale = fit

# Start in full screen mode (yes/no)
fullscreen = no

# Anti-aliasing (yes/no)
antialiasing = no

# Background for transparent images (none/grid/RGB, e.g. #112233)
transparency = #333333

# Window position (parent or absolute coordinates, e.g. 100,200)
position = parent

# Window size (parent, image, or absolute size, e.g. 800,600)
size = 1920,1080

# Window background mode/color (none/RGB, e.g. #112233)
background = #333333

# Run slideshow at startup (yes/no)
slideshow = no

# Slideshow image display time (seconds)
slideshow_time = 4

################################################################################
# Image list configuration
################################################################################

[list]

# Default order (none/alpha/random)
order = alpha

# Looping list of images (yes/no)
loop = yes

# Read directories recursively (yes/no)
recursive = no

# Open all files in the start directory (yes/no)
all = yes

################################################################################
# Font configuration
################################################################################

[font]

# Font name
name = monospace

# Font size (in pt)
size = 10

# Font color
color = #ffffff

# Drop shadow (none/RGB, e.g. #112233)
shadow = #000000

################################################################################
# Image meta info scheme (format, size, EXIF, etc)
################################################################################

[info]

# Mode on startup (off/brief/full)
mode = off

# Display scheme for the "full" mode: position = content
full.topleft = path
full.topright = scale
full.bottomleft = format
full.bottomright = filesize

# Display scheme for the "brief" mode: position = content
brief.topleft = name
brief.topright = scale
brief.bottomleft = imagesize
brief.bottomright = index

################################################################################
# Key binding section: key = action [parameters]
# Use the `xkbcli` tool to get key name: `xkbcli interactive-wayland`
################################################################################

[keys]

Home = first_file
End = last_file

s = slideshow
f = fullscreen
a = antialiasing
r = reload
i = info

Left = prev_file
Right = next_file

Up = zoom +10
Down = zoom -10

plus = zoom +10
minus = zoom -10

z = zoom fit

space = zoom real

bracketleft = rotate_left
bracketright = rotate_right

m = flip_vertical
M = flip_horizontal

Escape = exit
q = exit

# vim: filetype=dosini

@charbelnicolas
Copy link
Author

vid_2024_03_22_23_48_34.mp4

@artemsen
Copy link
Owner

I also have parent in my own config, but I don't see any glitches.
Do you use Sway or some other compositor?
Do you use the scale factor for your display?

@charbelnicolas
Copy link
Author

I use labwc which is a wlroots (0.17.2) based compositor. I have not changed any scale factor for my display.

@artemsen
Copy link
Owner

I reproduced the bug, the reason is in lack of Sway =)
Swayimg tries to get size of the parent window, but labwc doesn't provide this info (there is no IPC socket for that).
I will try to fix it.

@artemsen artemsen added the bug Something isn't working label Mar 23, 2024
@charbelnicolas
Copy link
Author

That's great to hear! -_-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants