lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.28k stars 161 forks source link

Auto-resize Height & Width Setting Checkbox #341

Closed AlexAtkinson closed 5 years ago

AlexAtkinson commented 6 years ago

When hosting linux in a VM in a window, and then changing the VM to fullscreen, Tilda does not adjust to the new screen resolution, but instead preserves the height and width pixel settings. Please make the standard behavior to auto-resize (maintaining the specified window size by percentage) when screen size changes are detected, and add a checkbox enabling the user to prevent auto-resize if desired, though I expect this would go unused.

voidplayer commented 6 years ago

This seems quite an unusual behaviour. Unless the window is full screen, i dont know of any other program that resizes when you resize the vm

Do you have any example so we can look at the code?

lanoxx commented 5 years ago

This is fixed in the https://github.com/lanoxx/tilda/tree/wip/resize branch. It would be nice if you could test it and provide some feedback on how it works. Note, this will require that you compile tilda from the git sources using the wip/resize branch.

In order to implement this, I had to change the way tilda stores its configured size. It now uses the relative percentage rather than the absolute size in pixels. This also required a change in the wizard, which now shows two decimal digits in the percentage spinners under the appearance tab.

If you test this please pay attention to the following things:

  1. Are your original size settings properly migrated by tilda. This should happen automatically and tilda will comment out the deprecated values for max_width and max_height from the config file and instead write new width_percentage and height_percentage options with the migrated values.
  2. Is size of the tilda window updated reliably in all cases.
  3. Does the switch from absolute values to relative values cause any unforeseen side effects.
jojoob commented 5 years ago

On wip/resize: As soon as I change the width and high in the preferences tilda reports "A occurred while parsing the config file." on next tilda start. Edit: the problem also occurs with the default config.

screenshot from 2018-11-12 10-35-32

This is the config file after changing the preferences via the gui (auto created by tilda).

tilda_config_version="1.5~alpha"
# command=""
font="Monospace 11"
key="F2"
addtab_key="<Shift><Control>t"
fullscreen_key="F11"
toggle_transparency_key="F12"
toggle_searchbar_key="<Shift><Control>f"
closetab_key="<Shift><Control>w"
nexttab_key="<Control>Page_Down"
prevtab_key="<Control>Page_Up"
movetableft_key="<Shift><Control>Page_Up"
movetabright_key="<Shift><Control>Page_Down"
gototab_1_key="<Alt>1"
gototab_2_key="<Alt>2"
gototab_3_key="<Alt>3"
gototab_4_key="<Alt>4"
gototab_5_key="<Alt>5"
gototab_6_key="<Alt>6"
gototab_7_key="<Alt>7"
gototab_8_key="<Alt>8"
gototab_9_key="<Alt>9"
gototab_10_key="<Alt>0"
copy_key="<Shift><Control>c"
paste_key="<Shift><Control>v"
quit_key="<Shift><Control>q"
title="Tilda"
background_color="white"
# working_dir=""
web_browser="xdg-open"
increase_font_size_key="<Control>equal"
decrease_font_size_key="<Control>minus"
normalize_font_size_key="<Control>0"
# show_on_monitor=""
word_chars="-A-Za-z0-9,./?%&#:_"
lines=5000
x_pos=144
y_pos=27
tab_pos=0
expand_tabs=false
show_single_tab=false
backspace_key=0
delete_key=1
d_set_title=3
command_exit=2
scheme=3
slide_sleep_usec=20000
animation_orientation=0
timer_resolution=200
auto_hide_time=2000
on_last_terminal_exit=0
prompt_on_exit=false
palette_scheme=0
non_focus_pull_up_behaviour=0
cursor_shape=0
title_max_length=25
palette = {11822, 13364, 13878, 52428, 0, 0, 20046, 39578, 1542, 50372, 41120, 0, 13364, 25957, 42148, 30069, 20560, 31611, 1542, 38944, 39578, 54227, 55255, 53199, 21845, 22359, 21331, 61423, 10537, 10537, 35466, 58082, 13364, 64764, 59881, 20303, 29298, 40863, 53199, 44461, 32639, 43176, 13364, 58082, 58082, 61166, 61166, 60652}
scrollbar_pos=2
back_red=0
back_green=0
back_blue=0
text_red=65535
text_green=65535
text_blue=65535
cursor_red=65535
cursor_green=65535
cursor_blue=65535
width_percentage=85,000000
height_percentage=45,000000
scroll_history_infinite=false
scroll_on_output=false
notebook_border=false
scrollbar=false
grab_focus=true
above=true
notaskbar=true
bold=true
blinks=true
scroll_on_key=true
bell=false
run_command=false
pinned=true
animation=false
hidden=false
set_as_desktop=false
centered_horizontally=true
centered_vertically=false
enable_transparency=false
auto_hide_on_focus_lost=false
auto_hide_on_mouse_leave=false
title_behaviour=2
inherit_working_dir=true
command_login_shell=false
start_fullscreen=false
confirm_close_tab=false
back_alpha=65535
show_title_tooltip=false
# max_width=0
# max_height=0
# image=""
# show_on_monitor_number=0
# transparency=0
# title_max_length_flag=false
# antialias=false
# double_buffer=false
# scroll_background=false
# use_image=false
# min_width=0
# min_height=0
lanoxx commented 5 years ago

Interesting. I wonder if this might be caused by a different locale setting. Can you try to replace the , fraction separator with a dot to see if that helps:

Try:

width_percentage=85.000000

Same for height.

jojoob commented 5 years ago

The problem occurs even with the default config after restarting tilda. When I change the , to a . tilda reports the following error on startup:

screenshot from 2018-11-13 11-04-56

lanoxx commented 5 years ago

I pushed one more commit to output some debug values. Can you post the log output from the tilda start.

I am wondering if tilda is unable to get the available workarea to compute its size from the available workarea and the configured relative size.

jojoob commented 5 years ago

Tilda outputs: /home/jojoob/.config/tilda/config_1:68: unexpected token ','

/home/jojoob/.config/tilda/config_1:68-69

width_percentage=100,000000
height_percentage=100,000000

And when I replace the , with . before starting tilda the following is reported: /home/jojoob/.config/tilda/config_1:68: invalid floating point value for option 'width_percentage'

lanoxx commented 5 years ago

I merged the wip/resize branch today. This should be fixed now.