Merge lp:~stevenvandenbrandenstift/pantheon-terminal/fix-1375346 into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Steven Vanden Branden
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~stevenvandenbrandenstift/pantheon-terminal/fix-1375346
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 219 lines (+91/-15)
3 files modified
CMakeLists.txt (+40/-2)
src/Settings.vala (+5/-1)
src/TerminalWidget.vala (+46/-12)
To merge this branch: bzr merge lp:~stevenvandenbrandenstift/pantheon-terminal/fix-1375346
Reviewer Review Type Date Requested Status
Avi Romanoff (community) Disapprove
Review via email: mp+236680@code.launchpad.net

This proposal supersedes a proposal from 2014-09-30.

Description of the change

keeps compability with vte3-2.90 trough vala preprocessing
updates the (to be) deprecated Gdk.Color to Gdk.RGBA
Update for Vte 2.91

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote : Posted in a previous version of this proposal

Remove commented out code and fix code style violations, function() should be function ()

Revision history for this message
Steven Vanden Branden (stevenvandenbrandenstift) wrote : Posted in a previous version of this proposal

> Remove commented out code and fix code style violations, function() should be
> function ()

should all be fixed now, thanks

Revision history for this message
Rico Tzschichholz (ricotz) wrote : Posted in a previous version of this proposal

I can't speak for the maintainer of pantheon-terminal, but this should not be done like that.

Imo the support for vte2.91 *must* be conditional and vte2.90 support needs to be preserved. Also keeping in mind that Freya won't receive vte2.91.

Revision history for this message
Steven Vanden Branden (stevenvandenbrandenstift) wrote : Posted in a previous version of this proposal

owk i forget to adjust that. i will adjust it so it uses vte version 2.90 or higher

Revision history for this message
David Gomes (davidgomes) wrote :

If Freya's not getting vte 2.91 then I really don't see the need to merge this before it. Yes, I know that Pantheon Terminal isn't just used on elementary, but honestly I'd rather just have a vte 2.91 branch and merge it in trunk after Freya when we move to the new GNOME.

However, if you guys really think we should support both vte 2.91 and the old version then all of this does look ok except for some trailing whitespace and that I'd prefer that things inside #if would be indented.

Revision history for this message
Avi Romanoff (aroman) wrote :

Yeah, I don't like the idea of carrying a whole bunch of idefs either. i agree with david -- trunk should be based on whatever freya ships with. no need to bend over backwards for compatibility.

review: Disapprove

Unmerged revisions

644. By Steven Vanden Branden

fix backwards compability

643. By Steven Vanden Branden

remove new for structs

642. By Steven Vanden Branden

fix coding style

641. By Steven Vanden Branden

fix for vte 2.91

640. By Steven Vanden Branden

fix background and foreground colors

639. By Steven Vanden Branden

change deprecated fork_all with spawn_async

638. By Steven Vanden Branden

change Color to RGBA + remove obsolete background setting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-07-31 21:13:28 +0000
3+++ CMakeLists.txt 2014-10-01 10:36:02 +0000
4@@ -38,13 +38,26 @@
5 add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
6
7 find_package (PkgConfig)
8+pkg_check_modules (VTE vte-2.91)
9+if (NOT VTE_FOUND)
10 pkg_check_modules (DEPS REQUIRED
11 gthread-2.0
12 gtk+-3.0>=3.9.10
13 granite>=0.3.0
14+ libnotify
15+ gdk-3.0
16 vte-2.90
17+)
18+else (NOT VTE_FOUND)
19+pkg_check_modules (DEPS REQUIRED
20+ gthread-2.0
21+ gtk+-3.0>=3.9.10
22+ granite>=0.3.0
23 libnotify
24- gdk-3.0)
25+ gdk-3.0
26+ vte-2.91
27+)
28+endif (NOT VTE_FOUND)
29
30 add_definitions (${DEPS_CFLAGS})
31
32@@ -61,6 +74,7 @@
33 ensure_vala_version ("0.22.0" MINIMUM)
34
35 include (ValaPrecompile)
36+if (VTE_VERSION VERSION_LESS 0.38.0)
37 vala_precompile (VALA_C
38 src/DBus.vala
39 src/Settings.vala
40@@ -82,6 +96,30 @@
41 --thread
42 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/
43 )
44+else (VTE_VERSION VERSION_LESS 0.38.0)
45+vala_precompile (VALA_C
46+ src/DBus.vala
47+ src/Settings.vala
48+ src/PantheonTerminal.vala
49+ src/PantheonTerminalWindow.vala
50+ src/TerminalWidget.vala
51+ src/ForegroundProcessDialog.vala
52+ src/Constants.vala
53+PACKAGES
54+ vte-2.91
55+ granite
56+ gtk+-3.0
57+ libnotify
58+ gdk-3.0
59+ posix
60+CUSTOM_VAPIS
61+ vapi/config.vapi
62+OPTIONS
63+ --thread
64+ --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/
65+ --define=VTE291
66+)
67+endif (VTE_VERSION VERSION_LESS 0.38.0)
68
69 include (GSettings)
70 add_schema ("org.pantheon.terminal.gschema.xml")
71@@ -96,4 +134,4 @@
72 install (TARGETS pantheon-terminal RUNTIME DESTINATION bin)
73 install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/pantheon-terminal.desktop DESTINATION share/applications)
74 install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/open-pantheon-terminal-here.desktop DESTINATION share/applications)
75-install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/enable-zsh-completion-notifications DESTINATION share/pantheon-terminal)
76+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/enable-zsh-completion-notifications DESTINATION share/pantheon-terminal)
77\ No newline at end of file
78
79=== modified file 'src/Settings.vala'
80--- src/Settings.vala 2014-08-05 23:31:01 +0000
81+++ src/Settings.vala 2014-10-01 10:36:02 +0000
82@@ -63,7 +63,11 @@
83 public string foreground { get; set; }
84 public string background { get; set; }
85 public string cursor_color { get; set; }
86- public Vte.TerminalCursorShape cursor_shape { get; set; }
87+ #if VTE291
88+ public Vte.CursorShape cursor_shape { get; set; }
89+ #else
90+ public Vte.TerminalCursorShape cursor_shape { get; set; }
91+ #endif
92 public string palette { get; set; }
93
94 public string shell { get; set; }
95
96=== modified file 'src/TerminalWidget.vala'
97--- src/TerminalWidget.vala 2014-08-08 07:11:29 +0000
98+++ src/TerminalWidget.vala 2014-10-01 10:36:02 +0000
99@@ -99,9 +99,11 @@
100 public TerminalWidget (PantheonTerminalWindow parent_window) {
101
102 terminal_id = "%i".printf (terminal_id_counter++);
103-
104+
105+ #if !VTE291
106 /* Sets characters that define word for double click selection */
107 set_word_chars ("-A-Za-z0-9/.,_~#%?:=+@");
108+ #endif
109
110 restore_settings ();
111 settings.changed.connect (restore_settings);
112@@ -175,15 +177,24 @@
113 public void restore_settings () {
114 /* Load configuration */
115 int opacity = settings.opacity * 65535;
116- set_background_image (null);
117 set_opacity ((uint16) (opacity / 100));
118-
119+
120+ #if VTE291
121+ Gdk.RGBA background_color = Gdk.RGBA ();
122+ Gdk.RGBA foreground_color = Gdk.RGBA ();
123+
124+ background_color.parse (settings.background);
125+ foreground_color.parse (settings.foreground);
126+ #else
127 Gdk.Color background_color;
128 Gdk.Color.parse (settings.background, out background_color);
129
130 Gdk.Color foreground_color;
131 Gdk.Color.parse (settings.foreground, out foreground_color);
132
133+ set_background_image (null);
134+ #endif
135+
136 string[] hex_palette = {"#000000", "#FF6C60", "#A8FF60", "#FFFFCC", "#96CBFE",
137 "#FF73FE", "#C6C5FE", "#EEEEEE", "#000000", "#FF6C60",
138 "#A8FF60", "#FFFFB6", "#96CBFE", "#FF73FE", "#C6C5FE",
139@@ -200,20 +211,34 @@
140 current_string += settings.palette[i].to_string ();
141 }
142 }
143-
144+
145+ #if VTE291
146+ Gdk.RGBA[] palette = new Gdk.RGBA[16];
147+ #else
148 Gdk.Color[] palette = new Gdk.Color[16];
149+ #endif
150
151 for (int i = 0; i < hex_palette.length; i++) {
152+ #if VTE291
153+ Gdk.RGBA new_color= Gdk.RGBA();
154+ new_color.parse (hex_palette[i]);
155+ #else
156 Gdk.Color new_color;
157 Gdk.Color.parse (hex_palette[i], out new_color);
158-
159+ #endif
160 palette[i] = new_color;
161 }
162-
163+
164 set_colors (foreground_color, background_color, palette);
165
166+ #if VTE291
167+ Gdk.RGBA cursor_color = Gdk.RGBA ();
168+ cursor_color.parse (settings.cursor_color);
169+ #else
170 Gdk.Color cursor_color;
171 Gdk.Color.parse (settings.cursor_color, out cursor_color);
172+ #endif
173+
174 set_color_cursor (cursor_color);
175
176 /* Bold font */
177@@ -271,8 +296,11 @@
178 };
179
180 try {
181- this.fork_command_full (Vte.PtyFlags.DEFAULT, dir, { shell },
182- envv, SpawnFlags.SEARCH_PATH, null, out this.child_pid);
183+ #if VTE291
184+ this.spawn_sync (Vte.PtyFlags.DEFAULT, dir, { shell }, envv, SpawnFlags.SEARCH_PATH, null, out this.child_pid, null);
185+ #else
186+ this.fork_command_full (Vte.PtyFlags.DEFAULT, dir, { shell }, envv, SpawnFlags.SEARCH_PATH, null, out this.child_pid);
187+ #endif
188 } catch (Error e) {
189 warning (e.message);
190 }
191@@ -282,9 +310,11 @@
192 try {
193 string[]? program_with_args = null;
194 Shell.parse_argv (program_string, out program_with_args);
195-
196- this.fork_command_full (Vte.PtyFlags.DEFAULT, null, program_with_args,
197- null, SpawnFlags.SEARCH_PATH, null, out this.child_pid);
198+ #if VTE291
199+ this.spawn_sync (Vte.PtyFlags.DEFAULT, null, program_with_args, null, SpawnFlags.SEARCH_PATH, null, out this.child_pid, null);
200+ #else
201+ this.fork_command_full (Vte.PtyFlags.DEFAULT, null, program_with_args, null, SpawnFlags.SEARCH_PATH, null, out this.child_pid);
202+ #endif
203 } catch (Error e) {
204 warning (e.message);
205 }
206@@ -295,8 +325,12 @@
207 pid = -1;
208 return false;
209 }
210-
211+
212+ #if VTE291
213+ int pty = get_pty().fd;
214+ #else
215 int pty = this.pty_object.fd;
216+ #endif
217 int fgpid = Posix.tcgetpgrp (pty);
218
219 if (fgpid != this.child_pid && fgpid != -1) {

Subscribers

People subscribed via source and target branches