Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
2015732
Fix meson build
jeremypw Sep 3, 2024
f2ce414
Granite.Widgets -> Granite
jeremypw Sep 3, 2024
0e1fd23
Hdy -> Adwaita
jeremypw Sep 3, 2024
54771c8
Gtk.RadioButton -> Gtk.CheckButton
jeremypw Sep 3, 2024
ab48642
Gtk.Bin -> Gtk.Widget
jeremypw Sep 3, 2024
e6c92a8
Gtk.Clipboard -> Gdk.Clipboard
jeremypw Sep 3, 2024
ccd7ffe
Lose Gdk.Geometry
jeremypw Sep 3, 2024
76b054a
Lose configure_event
jeremypw Sep 3, 2024
9f6cbf2
Bind window properties to settings
jeremypw Sep 3, 2024
8e43130
Use Gtk.DropTarget
jeremypw Sep 3, 2024
2693045
GestureMultuPress -> GestureClick
jeremypw Sep 3, 2024
1124645
ColorButton -> ColorDialogButton
jeremypw Sep 3, 2024
91f6eba
Lose show_all ()
jeremypw Sep 3, 2024
2ab2e81
color_set -> notify["rgba"]
jeremypw Sep 3, 2024
584e824
Supply Gtk.ColorDialog; lose use_alpha
jeremypw Sep 3, 2024
349793b
Lose destroy.connect
jeremypw Sep 4, 2024
8736d45
Lose get_style_context ()
jeremypw Sep 4, 2024
f6b1bbc
Further fix style_context
jeremypw Sep 4, 2024
e538994
add () -> append ()
jeremypw Sep 4, 2024
4435b25
Fix DESTRUCTIVE_ACTION style
jeremypw Sep 4, 2024
6d2087d
Fix LINKED style
jeremypw Sep 4, 2024
b72e613
Fix Gtk.STYLE_CLASS_TITLE
jeremypw Sep 4, 2024
e47405c
Fix incorrect return in DND
jeremypw Sep 4, 2024
1b34a4a
Fix fullscreen
jeremypw Sep 4, 2024
e23c76b
Fix invalid members
jeremypw Sep 4, 2024
d8835f2
Lose Gdk.Screen
jeremypw Sep 4, 2024
4788137
Fix some non-existent function/signals
jeremypw Sep 4, 2024
7eedd2d
Fix some more non-existent things in MainWindow
jeremypw Sep 4, 2024
e84efd6
Fix more non-existent in MainWindow
jeremypw Sep 4, 2024
2fd5733
Fix more non-exist in MainWindow
jeremypw Sep 4, 2024
99c4e40
Fix controller construct in TerminalWidget
jeremypw Sep 4, 2024
0468465
Typo
jeremypw Sep 4, 2024
75db42c
Clipboard, MASK, get_toplevel () fixes
jeremypw Sep 4, 2024
1d3c59d
Gtk.DropTarget corrections
jeremypw Sep 4, 2024
d345107
ScrolledWindow fixes
jeremypw Sep 4, 2024
d9052ab
Fix return ownership
jeremypw Sep 4, 2024
7810c25
Fix extra arguments
jeremypw Sep 4, 2024
19a4628
Fix some missing arguments
jeremypw Sep 4, 2024
7b245d0
Fix some non-existent signals
jeremypw Sep 4, 2024
2540ee8
Fix scroll controller
jeremypw Sep 4, 2024
3a40c64
Replace get_window ()
jeremypw Sep 4, 2024
82f7c50
Fix variable name in Application
jeremypw Sep 4, 2024
a04be9f
iconify () -> minimize ()
jeremypw Sep 4, 2024
b27899a
Fix implicit begin
jeremypw Sep 4, 2024
58755c0
Fix new unhandled error
jeremypw Sep 4, 2024
eef2266
Fix access static member with instance (new)
jeremypw Sep 4, 2024
bbee656
Workaround readonly CheckButton.group
jeremypw Sep 4, 2024
45ff943
Correct EventControllerFocus creation (new)
jeremypw Sep 4, 2024
ea03ffa
Disambiguate add_controller for Gtk4 Window
jeremypw Sep 4, 2024
6eb8985
Terminal match_check_event -> check_match_at
jeremypw Sep 4, 2024
9baef98
Correct return in dialog.response.connect
jeremypw Sep 4, 2024
988c503
Gtk.Menu -> Gtk.PopoverMenu
jeremypw Sep 4, 2024
1cb2c71
Replace Gdk.KeyMap
jeremypw Sep 4, 2024
57b839d
Fix unreachable (new)
jeremypw Sep 4, 2024
14328f1
Scroll handler correct return value (new)
jeremypw Sep 4, 2024
acca1f8
Provide initial values (new)
jeremypw Sep 4, 2024
c827975
Remove unused
jeremypw Sep 4, 2024
5e2f07b
Do not sub-class GtkLabel
jeremypw Sep 4, 2024
87ea6b7
Fix access ColorDialogButton rgba
jeremypw Sep 4, 2024
aab12d8
Do not bind to non-existent properties of Adw.HeaderBar
jeremypw Sep 4, 2024
7f72c93
Add new saved-state keys
jeremypw Sep 4, 2024
8b073ba
Use saved state keys in Application
jeremypw Sep 4, 2024
276b8ad
Use Adw.ApplicationWindow.content
jeremypw Sep 4, 2024
eafa447
Merge branch 'master' into jeremypw/gtk4
jeremypw Sep 4, 2024
a7088ef
Fix lint
jeremypw Sep 4, 2024
4b59307
Update ci.yml; cleanup meson.build
jeremypw Sep 5, 2024
837595f
Do not use Gtk prefer-dark-style setting
jeremypw Sep 5, 2024
be45062
Revert adding libpcre2-8 to ci.yml
jeremypw Sep 5, 2024
2888d27
Update css for CheckButton
jeremypw Sep 5, 2024
dfe478b
Do not use Gtk system-prefers-dark
jeremypw Sep 5, 2024
110a163
Use data<string> not action_target
jeremypw Sep 5, 2024
ec30403
Set context menu parent
jeremypw Sep 5, 2024
efe2a7b
Init Granite before Adwaita
jeremypw Sep 5, 2024
76c91fa
Update SettingsPopover.vala css
jeremypw Sep 5, 2024
d59c9a4
Use Window is_active
jeremypw Sep 5, 2024
016c283
Merge branch 'master' into jeremypw/gtk4
jeremypw Sep 5, 2024
9b05281
Fix merge from master
jeremypw Sep 5, 2024
ead6393
Merge branch 'master' into jeremypw/gtk4
jeremypw Sep 5, 2024
4adab8a
Lose workarounds
jeremypw Sep 5, 2024
16c225e
Revert theme-button
jeremypw Sep 5, 2024
e2839cf
Add css provider to button style context
jeremypw Sep 5, 2024
77fdbc8
merge master
danirabbit Sep 5, 2024
37cdd81
No arrow on tab history popover
jeremypw Sep 6, 2024
aab852e
Application.css check -> radio
jeremypw Sep 6, 2024
d2b1350
Different css class for each theme
jeremypw Sep 6, 2024
1906728
Inactivate Application test temporarily
jeremypw Sep 6, 2024
e31d38c
Ensure them class starts with a letter
jeremypw Sep 6, 2024
d84d10d
Move zoom actions to main window
jeremypw Sep 6, 2024
9981851
Set MainWindow zoom accels in Application like Gtk3 branch
jeremypw Sep 6, 2024
326f268
Update header for changed files
jeremypw Sep 6, 2024
baf51ca
Remove commented out code
jeremypw Sep 6, 2024
711fca5
Remove another commented out line
jeremypw Sep 6, 2024
d332cb7
Rework context menu button handling
jeremypw Sep 8, 2024
2bbbe56
Merge branch 'master' into jeremypw/gtk4
jeremypw Sep 8, 2024
86cb147
Simpify popup_context_menu; comment
jeremypw Sep 8, 2024
b44c5ba
Fix merge
jeremypw Sep 8, 2024
f8d499b
Fix paste from clipboard ()
jeremypw Sep 8, 2024
6c22b16
Rework tracking control shift state
jeremypw Sep 8, 2024
0ac52b1
merge master
danirabbit Sep 8, 2024
730d8ca
fix merge mistake
danirabbit Sep 8, 2024
d370d79
Fix another merge mistake
danirabbit Sep 8, 2024
d8ad17d
actually fix merge for real
danirabbit Sep 8, 2024
48109ef
Connect directly to terminal zoom functions
jeremypw Sep 11, 2024
aa0ed3f
TerminalWidget: Lose control_pressed and shift_pressed members
jeremypw Sep 12, 2024
21353fe
Only handle natural copy paste as before
jeremypw Sep 12, 2024
6d92ee2
Merge branch 'master' into jeremypw/gtk4
jeremypw Sep 12, 2024
830ef1d
Handle both natural and native copy-paste
jeremypw Sep 12, 2024
2766d47
SIlence critical warning during shutdown
jeremypw Sep 15, 2024
a9d3d5a
Lose unused gtk settings
jeremypw Sep 15, 2024
b2db797
EventControllerScroll created inactive
jeremypw Sep 15, 2024
e801376
Manually implement keyboard zooming
jeremypw Sep 15, 2024
1ba5748
Lose unused actions
jeremypw Sep 15, 2024
c67bb86
Manually implement missing shortcuts
jeremypw Sep 15, 2024
c169dca
Merge branch 'master' into jeremypw/gtk4
jeremypw Sep 15, 2024
667072e
Add comment
jeremypw Sep 15, 2024
78d1a60
Focus current terminal on window focus in
jeremypw Sep 15, 2024
5dd55c8
Avoid memory leak - destroy context menu after close
jeremypw Sep 15, 2024
b5d76e9
Lose unneeded try/catch
jeremypw Sep 15, 2024
cce8c9c
Replace deprecated get_text_range
jeremypw Sep 16, 2024
8e35c77
Reduce scope of get_last_output; comment
jeremypw Sep 16, 2024
1bba82b
Use ShortcutController in TerminalWidget
jeremypw Sep 16, 2024
19093b8
Fix indent
jeremypw Sep 16, 2024
151c1de
Merge branch 'master' into jeremypw/gtk4
jeremypw Sep 16, 2024
750fc0d
Add css classes to color buttons
jeremypw Sep 17, 2024
d813cd9
Set propagation phase and limit of shortcut controller
jeremypw Sep 17, 2024
d051974
Use AlternativeTrigger for reload
jeremypw Sep 17, 2024
9d503a2
Lose unneeded refs to motion and key controller
jeremypw Sep 17, 2024
87fef18
Simplify ctrl-scroll zooming
jeremypw Sep 17, 2024
adbc010
Set scrollcontroller flags on focus enter
jeremypw Sep 30, 2024
063a0a1
Merge branch 'master' into jeremypw/gtk4
jeremypw Oct 11, 2024
331f4d0
Minor cleanup, edit comments
jeremypw Oct 11, 2024
498006b
Fix typo
jeremypw Oct 11, 2024
7281150
Fix confirm close tab with foreground process
jeremypw Oct 11, 2024
68f7bb8
Use AppInfo to launch in Files or Browser
jeremypw Oct 17, 2024
7e1f235
Read clipboard async if ContentProvider not provided
jeremypw Oct 17, 2024
a027640
Merge branch 'master' into jeremypw/gtk4
jeremypw Nov 19, 2024
8261406
Fix increase/decrease font size
jeremypw Nov 19, 2024
c33fa6f
Cleanup commented out code
jeremypw Nov 19, 2024
bc86b67
Remove unused
jeremypw Nov 19, 2024
72f0453
Handle drop non-uri text
jeremypw Nov 19, 2024
c2e2004
Use spawn_async
jeremypw Nov 24, 2024
eee5549
Merge branch 'master' into jeremypw/gtk4
jeremypw Jan 7, 2025
8d4559a
Fix reset, reload, close tab, close window with foreground process
jeremypw Jan 8, 2025
e6d7708
Merge branch 'master' into jeremypw/gtk4
jeremypw Jul 19, 2025
ba0cf30
Show maximise decoration on startup
jeremypw Jul 20, 2025
450a23f
Ensure tab closes without terminal warnings if shell exits
jeremypw Jul 20, 2025
21f03fd
Ignore trailing newlines in unsafe paste
jeremypw Jul 20, 2025
869b1e1
Present and resize new window before transferring tab
jeremypw Jul 21, 2025
cdb57bf
Present new window after dropping tab on desktop
jeremypw Jul 21, 2025
11b7da6
Disable move to new window if only one tab
jeremypw Jul 21, 2025
8edead2
Merge branch 'master' into jeremypw/gtk4
jeremypw Aug 1, 2025
0088b75
Merge master
danirabbit Aug 11, 2025
b0dbc80
merge master
danirabbit Aug 15, 2025
f2087da
Merge branch 'master' into jeremypw/gtk4
jeremypw Aug 22, 2025
8055981
Correct licence
jeremypw Aug 24, 2025
6ae7bda
Remove unneeded comment
jeremypw Aug 24, 2025
1b123d4
Group search_toolbar code together, modernize
jeremypw Aug 24, 2025
e41592e
Add whitespace
jeremypw Aug 24, 2025
f3e4962
More whitespace
jeremypw Aug 24, 2025
c7cbe66
Revert some changes to meson.build and srx/meson.build
jeremypw Aug 25, 2025
9e41d35
Fix header height
danirabbit Aug 25, 2025
5b5bb59
Fix color button styles
danirabbit Aug 25, 2025
b9371b4
Fix contrast image pixel size
danirabbit Aug 25, 2025
4fe0556
settingspopover: revert odd spacing, private box
danirabbit Aug 25, 2025
f54e37e
remove unreachable catch
danirabbit Aug 25, 2025
284b695
TerminalWidget: fix bad license header
danirabbit Aug 25, 2025
63e3f2b
Don't use Adw style manager
danirabbit Aug 25, 2025
74729fc
remove hdy comment
danirabbit Aug 25, 2025
8d7bb7a
Merge branch 'master' into jeremypw/gtk4
jeremypw Aug 25, 2025
64b68dd
Do not destroy color pref dialog when closed
jeremypw Aug 27, 2025
1569d14
Remove merge residue
jeremypw Aug 27, 2025
07d4e37
Use PARSE_RELAXED UriFlag when dropping
jeremypw Aug 27, 2025
dd2ad50
Remove redundant lines
jeremypw Aug 27, 2025
89edb14
Correct comment syntax
jeremypw Aug 27, 2025
1db1b68
Merge branch 'master' into jeremypw/gtk4
jeremypw Aug 31, 2025
49671d9
Fix faulty merge of master
jeremypw Aug 31, 2025
2d291db
Fix close after cancel; simplify
jeremypw Aug 31, 2025
ee3e150
Revert to ForegroundProcessDialog
jeremypw Aug 31, 2025
deac57f
Fix background opacity
jeremypw Sep 1, 2025
6c52468
Show custom dialog when custom theme active
jeremypw Sep 1, 2025
3edbf9f
Insert missing braces in kill_fg ()
jeremypw Sep 1, 2025
a7ce841
Update MainWindow.vala
danirabbit Sep 1, 2025
6c4a3b0
Partially fix tests in Gtk4 (#913)
jeremypw Sep 7, 2025
a9c2e3f
ApplicationTests on stable only (#916)
jeremypw Sep 7, 2025
e7eb963
Revert some unnecessary changes
jeremypw Sep 7, 2025
93032ad
Pre-reject drop on add button if not valid location
jeremypw Sep 7, 2025
59b1aa7
Revert "ApplicationTests on stable only (#916)"
jeremypw Sep 7, 2025
103796c
Revert "Partially fix tests in Gtk4 (#913)"
jeremypw Sep 7, 2025
2d6fa45
Comment out headless tests
jeremypw Sep 7, 2025
294a184
Add flatpak manifest (based on BlackBox); adjust vte dependency
jeremypw Sep 11, 2025
a257bf6
Add terminal_is_flatpak option
jeremypw Sep 11, 2025
363816b
Modify finish args like Ptyxis
jeremypw Sep 11, 2025
7a3c889
Copy some Flatpak utils from BlackBox
jeremypw Sep 11, 2025
b106406
Tweak Flatpak utils
jeremypw Sep 14, 2025
9ed6a29
Revert "Add terminal_is_flatpak option"
jeremypw Sep 11, 2025
89fd0d1
Fix window title in Flatpak
jeremypw Sep 16, 2025
5dc17da
Cleanup, reorganize
jeremypw Sep 16, 2025
ab90f69
Simplify and dry
jeremypw Sep 16, 2025
6c42b0e
Start fixing get current directory and foreground pid in flatpak
jeremypw Sep 18, 2025
9025409
MainWindow check for same name after creating/spawning new tab
jeremypw Sep 18, 2025
b98d4e5
MainWindow: Cleanup, better naming
jeremypw Sep 18, 2025
dcd8fa8
SpawnShell: Initialize program_string amd current_working_directory
jeremypw Sep 18, 2025
10f8160
Run contents changed after committing new line only
jeremypw Sep 18, 2025
e886065
Make program_string private set, update in contents changed.
jeremypw Sep 18, 2025
befc8c6
TerminalWidget: Cleanup and comments
jeremypw Sep 18, 2025
b4d3f4a
Replace and simplify method of getting foreground process id
jeremypw Sep 18, 2025
09a838f
TerminalWidget: Fix unhandled errors; lose unnecessary async
jeremypw Sep 18, 2025
3f41c9e
FlatpakUtils: Check enough parts in array, comment, format
jeremypw Sep 18, 2025
13c05e0
Fix disambiguation overriding program label
jeremypw Sep 18, 2025
737a13b
No longer async
jeremypw Sep 18, 2025
ae55d7c
Fix closing tab - initialize fg_pid and child_pid
jeremypw Sep 19, 2025
5bc13fa
Fix closing window, check confirmation result
jeremypw Sep 19, 2025
6a4cb01
Fix close window - check confirmation result
jeremypw Sep 19, 2025
e6f18b5
Fix detection of foreground process end
jeremypw Sep 19, 2025
3c1befe
Comment out non-functional tests. Test in flatpak build
jeremypw Sep 20, 2025
443a561
Fix respawn due to extraneous LF from flatpak util
jeremypw Sep 21, 2025
a81b338
Fix and simplify reload action
jeremypw Sep 21, 2025
7a92f56
Sanitize when needed when getting selection or link.
jeremypw Sep 22, 2025
0cb216e
Do not assume complete uri when getting default app info for uri
jeremypw Sep 22, 2025
da10c28
Remove commented out code
jeremypw Sep 22, 2025
c8acc38
Merge branch 'jeremypw/fix-launch-browser' into gtk4/flatpak
jeremypw Sep 22, 2025
0ef43f5
Bump min Vte version to 0.76
jeremypw Sep 22, 2025
d932758
Use new builtin Vte context_menu_model property
jeremypw Sep 22, 2025
534ea85
Fix get value from clipboard content provider
jeremypw Sep 22, 2025
f8e9517
Fix getting value from primary selection
jeremypw Sep 22, 2025
e7a7698
Check confirmed in reset and reload actions
jeremypw Sep 22, 2025
770f0d9
Check confirmed in reset and reload actions
jeremypw Sep 22, 2025
6b5b91f
Lose unused var
jeremypw Sep 22, 2025
d2451c4
Kill fg and clear screen when resetting
jeremypw Sep 22, 2025
68828ba
Reduce Platform version to 8.1 to avoid cli spam
jeremypw Sep 22, 2025
9a8ea6a
Merge branch 'jeremypw/gtk4' into gtk4/flatpak
jeremypw Sep 22, 2025
4eba743
Merge branch 'master' into jeremypw/gtk4
jeremypw Sep 24, 2025
9416ede
Merge branch 'jeremypw/gtk4' into gtk4/flatpak
jeremypw Sep 24, 2025
85c76e7
Revert unneeded changes
jeremypw Sep 24, 2025
3ce35b5
Merge branch 'jeremypw/gtk4' of https://github.com/elementary/termina…
jeremypw Sep 24, 2025
13bba65
More concise Shortcut construction
jeremypw Sep 24, 2025
be99b00
Merge branch 'jeremypw/gtk4' into gtk4/flatpak
jeremypw Sep 24, 2025
b938aa5
Modify comment
jeremypw Sep 24, 2025
086c26a
Merge branch 'jeremypw/gtk4' into gtk4/flatpak
jeremypw Sep 24, 2025
778ea18
Use @BASENAME@ instead of hard coded
jeremypw Sep 25, 2025
e75e90c
Add Flatpak CI
jeremypw Sep 25, 2025
97a1e00
Remove build CI since Flatpak CI builds too (no conditional compilation)
jeremypw Sep 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,38 @@ on:
- synchronize

jobs:
build:
runs-on: ubuntu-latest
flatpak:
name: Flatpak (${{ matrix.configuration.arch }})
runs-on: ${{ matrix.configuration.runs-on }}

strategy:
fail-fast: false
matrix:
version: [stable, unstable, development-target]
configuration:
- arch: x86_64
runs-on: ubuntu-latest
- arch: aarch64
runs-on: ubuntu-24.04-arm
# Don't fail the whole workflow if one architecture fails
fail-fast: false

container:
image: ghcr.io/elementary/docker:${{ matrix.version }}
image: ghcr.io/elementary/flatpak-platform/runtime:8.1-${{ matrix.configuration.arch }}
options: --privileged

steps:
- uses: actions/checkout@v5
- name: Install Dependencies
run: |
apt update
apt install -y desktop-file-utils gettext libgranite-dev libgtk-3-dev libhandy-1-dev libvte-2.91-dev libxml2-utils meson valac xvfb
- name: Build
run: |
meson setup build
meson compile -C build
meson test -C build --print-errorlogs
meson install -C build
- name: Checkout
uses: actions/checkout@v5

- name: Build
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.5
with:
bundle: terminal.flatpak
manifest-path: io.elementary.terminal.yml
run-tests: true
repository-name: appcenter
repository-url: https://flatpak.elementary.io/repo.flatpakrepo
cache-key: "flatpak-builder-${{ github.sha }}"
arch: ${{ matrix.configuration.arch }}

lint:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*~
build/
.flatpak/
.flatpak-builder
30 changes: 3 additions & 27 deletions data/Application.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
/*
* Copyright 2017-2020 elementary, Inc. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 3, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
* Copyright 2017-2024 elementary, Inc. (https://elementary.io)
* SPDX-License-Identifier: LGPL-3.0-only
*/

/* Make sure terminal background can use colors with alpha */
.terminal-window.background {
Expand All @@ -31,7 +18,6 @@ vte-terminal {
}

.color-button radio {
padding: 10px;
-gtk-icon-shadow: none;
}

Expand All @@ -43,13 +29,3 @@ vte-terminal {
-gtk-icon-source: -gtk-icontheme("check-active-symbolic");
}

/* Workaround Hdy.Tabbar transparent area. Remove during GTK 4 port */
tabbar .box {
margin: 0;
padding-top: 2px;
}

/* Workaround for context menu styles. Remove during GTK4 port */
menu {
font: initial;
}
23 changes: 14 additions & 9 deletions data/io.elementary.terminal.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@
</enum>

<schema path="/io/elementary/terminal/saved-state/" id="io.elementary.terminal.saved-state">
<key name="window-size" type="(ii)">
<default>(600, 400)</default>
<summary>Most recent window size</summary>
<description>Most recent window size (width, height)</description>
</key>
<key name="window-state" enum="pantheon-terminal-window-states">
<default>"Normal"</default>
<summary>The saved state of the window.</summary>
<description>The saved state of the window.</description>
<key name="window-height" type="i">
<default>700</default>
<summary>Most recent window height</summary>
<description>Most recent window height</description>
</key>
<key name="window-width" type="i">
<default>1024</default>
<summary>Most recent window width</summary>
<description>Most recent window width</description>
</key>
<key name="is-maximized" type="b">
<default>false</default>
<summary>Whether window is maximized</summary>
<description>Whether the main application window is maximized or not</description>
</key>
<key name="tabs" type="as">
<default>[]</default>
Expand Down
2 changes: 1 addition & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ i18n.merge_file(

i18n.merge_file(
input: 'terminal.metainfo.xml.in',
output: meson.project_name() + '.metainfo.xml',
output: '@BASENAME', # Must use @BASENAME@ else flatpak build fails
po_dir: podir / 'extra',
install: true,
install_dir: datadir / 'metainfo'
Expand Down
50 changes: 50 additions & 0 deletions io.elementary.terminal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
app-id: io.elementary.terminal
runtime: io.elementary.Platform
runtime-version: '8.1'
sdk: io.elementary.Sdk
command: io.elementary.terminal

finish-args:
- '--metadata=X-DConf=migrate-path=/io/elementary/terminal/'
- '--allow=devel'
- '--filesystem=host'
- '--filesystem=xdg-run/gvfsd'
- '--share=ipc'
- '--share=network'
- '--socket=fallback-x11'
- '--socket=wayland'
- '--socket=session-bus'
- '--device=all'
- '--talk-name=org.freedesktop.Flatpak'

cleanup:
- '/include'
- '/lib/pkgconfig'
- '/lib/cmake'
- '/lib/girepository-1.0'
- '/share/gir-1.0'
- '/share/vala'
- '*.a'
- '*.la'

build-options:
libdir: /app/lib

modules:
- name: vte
buildsystem: meson
config-opts:
- '-Dgtk4=true'
- '-Dgtk3=false'
sources:
- type: archive
url: https://download.gnome.org/sources/vte/0.76/vte-0.76.6.tar.xz
sha256: 9ac739ad73b63e109269088a6d27029b6d45700b0993977c1e00ed1bcb1a3d39

- name: terminal
buildsystem: meson
sources:
- type: dir
path: .
run-tests: true

15 changes: 6 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@ endif
gnome = import('gnome')
i18n = import('i18n')

glib_version = '>=2.40'

glib_version = '>=2.50'
glib_dep = dependency('glib-2.0', version: glib_version)
gobject_dep = dependency('gobject-2.0', version: glib_version)
gio_dep = dependency('gio-2.0', version: glib_version)
gee_dep = dependency('gee-0.8')
gtk_dep = dependency('gtk+-3.0', version: '>=3.24')
granite_dep = dependency('granite', version: '>=6.1')
handy_dep = dependency('libhandy-1', version: '>=0.83')
vte_dep = dependency('vte-2.91', version: '>=0.59')
pcre2_dep = dependency('libpcre2-8')

gtk_dep = dependency('gtk4', version: '>=4.1')
granite_dep = dependency('granite-7', version: '>=7.5')
adwaita_dep = dependency('libadwaita-1', version: '>=1.5')
vte_dep = dependency('vte-2.91-gtk4', version: '>=0.76')
pcre2_dep = dependency('libpcre2-8', version: '>=10.4') # Perl Regular Expression library
posix_dep = valac.find_library('posix')
linux_dep = valac.find_library('linux', required: false)
m_dep = cc.find_library('m', required : false)
Expand Down Expand Up @@ -54,7 +52,6 @@ endif
add_project_arguments(
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
'-DPCRE2_CODE_UNIT_WIDTH=0',
'-DHANDY_USE_UNSTABLE_API',
language:'c'
)

Expand Down
41 changes: 27 additions & 14 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ public class Terminal.Application : Gtk.Application {

public bool is_testing { get; set construct; }

public static bool is_running_in_flatpak;
private static Themes themes;

static construct {
is_running_in_flatpak = FileUtils.test ("/.flatpak-info", FileTest.IS_REGULAR);
}

public Application () {
Object (
application_id: "io.elementary.terminal", /* Ensures only one instance runs */
Expand Down Expand Up @@ -224,7 +229,8 @@ public class Terminal.Application : Gtk.Application {

protected override void startup () {
base.startup ();
Hdy.init ();
Granite.init ();
Adw.init ();

saved_state = new GLib.Settings ("io.elementary.terminal.saved-state");
settings = new GLib.Settings ("io.elementary.terminal.settings");
Expand All @@ -238,8 +244,8 @@ public class Terminal.Application : Gtk.Application {
* https://gitlab.gnome.org/GNOME/vte/blob/0.68.0/src/vtegtk.cc#L844-847
* To be able to overwrite their styles, we need to use +1.
*/
Gtk.StyleContext.add_provider_for_screen (
Gdk.Screen.get_default (),
Gtk.StyleContext.add_provider_for_display (
Gdk.Display.get_default (),
provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION + 1
);
Expand Down Expand Up @@ -269,16 +275,6 @@ public class Terminal.Application : Gtk.Application {

set_accels_for_action ("app.new-window", { "<Control><Shift>N" });
set_accels_for_action ("app.quit", { "<Control><Shift>Q" });

set_accels_for_action (TerminalWidget.ACTION_COPY, TerminalWidget.ACCELS_COPY);
set_accels_for_action (TerminalWidget.ACTION_COPY_OUTPUT, TerminalWidget.ACCELS_COPY_OUTPUT);
set_accels_for_action (TerminalWidget.ACTION_PASTE, TerminalWidget.ACCELS_PASTE);
set_accels_for_action (TerminalWidget.ACTION_RELOAD, TerminalWidget.ACCELS_RELOAD);
set_accels_for_action (TerminalWidget.ACTION_SCROLL_TO_COMMAND, TerminalWidget.ACCELS_SCROLL_TO_COMMAND);
set_accels_for_action (TerminalWidget.ACTION_SELECT_ALL, TerminalWidget.ACCELS_SELECT_ALL);
set_accels_for_action (TerminalWidget.ACTION_ZOOM_DEFAULT, TerminalWidget.ACCELS_ZOOM_DEFAULT);
set_accels_for_action (TerminalWidget.ACTION_ZOOM_IN, TerminalWidget.ACCELS_ZOOM_IN);
set_accels_for_action (TerminalWidget.ACTION_ZOOM_OUT, TerminalWidget.ACCELS_ZOOM_OUT);
}

protected override int command_line (ApplicationCommandLine command_line) {
Expand Down Expand Up @@ -315,10 +311,27 @@ public class Terminal.Application : Gtk.Application {
}

if (options.lookup ("minimized", "b", out minimized) && minimized) {
window.iconify ();
window.minimize ();
} else {
window.present ();
}

if (is_first_window) {
/*
* This is very finicky. Bind size after present else set_titlebar gives us bad sizes
* Set maximize after height/width else window is min size on unmaximize
* Bind maximize as SET else get get bad sizes
*/
saved_state.bind ("window-height", window, "default-height", SettingsBindFlags.DEFAULT);
saved_state.bind ("window-width", window, "default-width", SettingsBindFlags.DEFAULT);

if (saved_state.get_boolean ("is-maximized")) {
window.maximize ();
}

saved_state.bind ("is-maximized", window, "maximized", SettingsBindFlags.SET);
}

return 0;
}

Expand Down
Loading