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

Set correct sidebar/message window positions before showing the… #576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

techee
Copy link
Member

@techee techee commented Jul 14, 2015

… main winodw

At the moment there's a slightly ugly redraw of the sidebar and message window when starting Geany because configuration_apply_settings(), which sets their correct positions, is called after gtk_widget_show() on the main window. When moving it before, this issue disappears.

I'm definitely not a GTK expert and the comment above configuration_apply_settings() says it should be called after the window is realized but is this really the case? It seems to work fine even with this change and even if this isn't the correct approach, I guess there must be some way to set the initial positions before showing the window (other editors start with the correct sizes when launched).

This patch isn't meant to be applied as it is (if the comment above configuration_apply_settings() is wrong, it should be removed at least), it's mainly meant for quick testing and further discussion.

@techee
Copy link
Member Author

techee commented Dec 12, 2015

@b4n Any opinion on this one? The reason I'm asking is that as I was playing with the big files and testing Geany performance now, I triggered this quite frequently and actually in a non-cosmetic way.

It seems that when opening Geany takes longer because e.g. a bigger file has to be parsed, the redraw to the correct size gets somehow skipped and Geany gets into a strange state where it's drawn with the sizes from Glade and is kind of frozen (clicking inside editor doesn't work, menus don't react etc.). It only helps if I click to another editor tab after which Geany gets redrawn and starts working normally.

This strange behavior doesn't happen if the correct sizes are applied before the initial show().

@codebrainz
Copy link
Member

We should also show the main window before loading any files. It's better to have Geany show and then freeze/lockup than to have nothing happen when the user clicks the Geany icon. I experienced this a few times while testing that really slow Java file, I thought Geany was crashing on startup or something, but it was just that the really slow file was in session history. About 5 minutes passed before any sign of Geany running appeared.

@elextr
Copy link
Member

elextr commented Dec 12, 2015

@codebrainz S/B a separate issue, but yeah showing Geany with "Loading Session Files..." would be better.

@techee looks sensible to me.

@techee
Copy link
Member Author

techee commented Dec 12, 2015

@codebrainz Good point, I tried this with the above patch and it seems to work - hope it doesn't have any side-effects. It's a bit unusual to see the empty window but I think I just have to get used to it.

@elextr
Copy link
Member

elextr commented Dec 12, 2015

Can the status bar say "Loading Session Files..."?

@techee
Copy link
Member Author

techee commented Dec 13, 2015

@elextr Done. The only problem was what to use to clear the "Loading session files..." message once they are loaded - I used the "This is Geany 1.26" message (which means that the message isn't displayed in the status window at the very beginning of the log).

I also modified the patch slightly so the geany-startup-complete is emitted after all the session files get loaded in case some plugins depend on this behavior.

@elextr
Copy link
Member

elextr commented Dec 13, 2015

I used the "This is Geany 1.26" message (which means that the message isn't displayed in the status window at the very beginning of the log).

Seems like a good thing to show when Geany is ready to use.

…winodw

Otherwise the window is first drawn with some default values and then
redrawn with the saved ones which doesn't look nice.
@techee techee changed the title [RFC] Set correct sidebar/message window positions before showing the… Set correct sidebar/message window positions before showing the… Feb 29, 2016
gtk_paned_set_position(GTK_PANED(ui_lookup_widget(main_widgets.window, "hpaned1")), hpan_position);
gtk_paned_set_position(GTK_PANED(ui_lookup_widget(main_widgets.window, "vpaned1")), vpan_position);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe the only reason why it was here was that hpan_position and vpan_position were read in this file and accessible only here.

@techee
Copy link
Member Author

techee commented Feb 29, 2016

@b4n I've updated the patch and separated the idle-opening of session here #924. I believe the part here is quite simple and safe for 1.27.

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

Successfully merging this pull request may close these issues.

None yet

3 participants