Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Fixed issue #1451 #2026

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fixed issue #1451 #2026

wants to merge 5 commits into from

Conversation

SadaleNet
Copy link

When --minimize flag is specified in HexChat execution command, its window now minimizes right after it starts.

In the past, the Hexchat window often did not minimize until it finishes joining the network.

When --minimize flag is specified in HexChat execution command, its window now minimizes right after it starts.

In the past, the Hexchat window oftem did not minimize until it finishes joining the network.
@Lartza
Copy link

Lartza commented Jul 29, 2017

Seems to work on Windows 10. Without the patch it doesn't wait for a network to be joined for me but the window does appear for a brief second or two, with patch it's minimized from the start.

@@ -359,6 +359,12 @@ typedef enum {
TAB_STATE_NEW_HILIGHT = (1 << 2),
} tab_state_flags;

typedef enum { //Works with gtkutil_window_new()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C89 style comments please: /* Works with gtkutil_window_new() */

START_WINDOWED = 0,
START_ICONIFIED = 4,
START_ON_TRAY = 8,
} start_type;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start_type_flags to be consistent with other similar enums.

@@ -264,7 +264,8 @@ cv_tree_focus (chan *ch)
dest_y = cell_rect.y - ((vis_rect.height - cell_rect.height) * 0.5);
if (dest_y < 0)
dest_y = 0;
gtk_tree_view_scroll_to_point (tree, -1, dest_y);
if (gtk_widget_get_realized( GTK_WIDGET (tree) )) //When Hexchat is started with the flag --minimize=2, Fixes Gtk-CRITICAL **: IA__gtk_tree_view_scroll_to_point: assertion 'gtk_widget_get_realized (GTK_WIDGET (tree_view))' failed
Copy link
Member

@TingPing TingPing Aug 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace issues

gtk_widget_get_realized (GTK_WIDGET (tree)))

@@ -3168,7 +3168,8 @@ mg_create_topwindow (session *sess)

mg_place_userlist_and_chanview (sess->gui);

gtk_widget_show (win);
if(sess->start_state!=START_ON_TRAY)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the one below OK?

+	if(sess->start_state != START_ON_TRAY)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space after if

@@ -3262,7 +3263,8 @@ mg_create_tabwindow (session *sess)

mg_place_userlist_and_chanview (sess->gui);

gtk_widget_show (win);
if(sess->start_state!=START_ON_TRAY)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace

win = GTK_WINDOW (hexchat_get_info (ph, "gtkwin_ptr"));
if (!win)
return FALSE;
return tray_toggle_visibility_win(win, force_hide);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify. Is the code below the correct format?

+	win = GTK_WINDOW (hexchat_get_info (ph, "gtkwin_ptr"));
+	if (!win)
+		return FALSE;
+	return tray_toggle_visibility_win (win, force_hide);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@SadaleNet
Copy link
Author

@TingPing Thanks for reviewing my code. Is there a coding style guideline for HexChat? I couldn't find it anywhere. :(

@TingPing
Copy link
Member

TingPing commented Aug 4, 2017

@SadaleNet Sorry there is no formal document over it. =\

@TingPing
Copy link
Member

TingPing commented Aug 7, 2017

Some warnings to fix:

../src/fe-gtk/gtkutil.c: In functiongtkutil_window_new’:
../src/fe-gtk/gtkutil.c:605:31: warning: passing argument 1 oftray_toggle_visibility_winfrom incompatible pointer type [-Wincompatible-pointer-types]
   tray_toggle_visibility_win (win, TRUE);
                               ^~~
In file included from ../src/fe-gtk/gtkutil.c:28:0:
../src/fe-gtk/plugin-tray.h:26:10: note: expectedGtkWindow * {aka struct _GtkWindow *}’ but argument is of typeGtkWidget * {aka struct _GtkWidget *}’
 gboolean tray_toggle_visibility_win (GtkWindow *win, gboolean force_hide);

@@ -598,6 +599,10 @@ gtkutil_window_new (char *title, char *role, int width, int height, int flags)
gtk_window_set_transient_for (GTK_WINDOW (win), GTK_WINDOW (parent_window));
gtk_window_set_destroy_with_parent (GTK_WINDOW (win), TRUE);
}
if (flags & START_ICONIFIED)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are mixing two different sets of flags here which is very unclear.

Copy link
Author

@SadaleNet SadaleNet Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew. My pull request try to minimize the changes on the code.

How would you like me to fix that? Make the function accept one more parameter?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea on how am I supposed to fix that? I wouldn't continue until you give me a pointer to the solution that you'd like to have.

Also, please try to give me all the feedback in batch. It's more time-efficient for us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add another argument for start flags.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants