Skip to content

Porting to Gtk::Application - part 1 - #2497

Merged
ice0 merged 11 commits into
synfig:masterfrom
rodolforg:please-use-gtk-application
Jan 30, 2022
Merged

ice0 merged 11 commits into
synfig:masterfrom
rodolforg:please-use-gtk-application

Conversation

@rodolforg

@rodolforg rodolforg commented Jan 5, 2022 •

Copy link
Copy Markdown
Contributor

Need to test:

  • Opening of files named with non-latin characters on MS Windows
  • Splash Screen is working
  • --console is working on MS Windows
  • Synfig Studio plugins are working on MS Windows
  • synfig tool still works

Comment thread synfig-studio/src/gui/app.cpp Resolved
Comment thread synfig-core/src/synfig/main.cpp Resolved
Comment thread synfig-studio/src/gui/app.cpp Outdated
freopen("NUL", "w", stdout);
freopen("NUL", "w", stderr);
freopen("NUL", "r", stdin);
ios::sync_with_stdio();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

std::ios::sync_with_stdio

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK. But I don't even know why such code exists: the comment left by blackwarthog does not mention what bug it prevents: stderr, stdout, stdin does not even exist on Windows without the --console approach.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suggest removing this code. In any case, it is better to return the "strange" error and fix it.

Comment thread synfig-studio/src/gui/app.cpp Resolved
Comment thread synfig-studio/src/gui/main.cpp Resolved
Comment thread synfig-studio/src/gui/app.cpp Resolved
@rodolforg
rodolforg force-pushed the please-use-gtk-application branch 2 times, most recently from 003305e to 41187f0 Compare January 5, 2022 15:39
Comment thread synfig-studio/src/gui/main.cpp Resolved
Comment thread synfig-studio/src/gui/app.cpp Resolved
@rodolforg
rodolforg force-pushed the please-use-gtk-application branch 2 times, most recently from 180e136 to 7620d9c Compare January 5, 2022 17:04
@rodolforg

Copy link
Copy Markdown
Contributor Author

@ice0 please read and review last commit

Comment thread synfig-studio/src/gui/app.cpp Resolved
@rodolforg
rodolforg force-pushed the please-use-gtk-application branch 3 times, most recently from afb142b to a77b7b4 Compare January 7, 2022 03:59
@ice0

ice0 commented Jan 9, 2022

Copy link
Copy Markdown
Collaborator

@rodolforg
I think it's ready to be merged.
#2212 is not fixed by this PR, I made another PR to fix this issue: #2505

@rodolforg
rodolforg marked this pull request as ready for review January 9, 2022 02:04
@rodolforg
rodolforg requested a review from ice0 January 9, 2022 02:04
@rodolforg

Copy link
Copy Markdown
Contributor Author

OK :)
I hope Synfig gets more integrated into MacOS too - although I don't use it XD
I read Gtk3 (with Application) has more to do about it.

@rodolforg
rodolforg force-pushed the please-use-gtk-application branch from a77b7b4 to a4df64d Compare January 9, 2022 20:28
@ice0

ice0 commented Jan 10, 2022

Copy link
Copy Markdown
Collaborator

@morevnaproject @rodolforg

I need to make one more PR (fix windows plugins) before this will be merged.

@ice0

ice0 commented Jan 26, 2022

Copy link
Copy Markdown
Collaborator

@rodolforg
I found another way to fix plugins error, so please rebase, and I merge this PR.

DhairyaBahl and others added 8 commits January 29, 2022 09:59
Everybody just wants the root path, not the bin path

binary_path : executable file path, including its filename
	e.g. /usr/bin/synfigstudio
base_path: directory path of executable/binary
	e.g. /usr/bin
root_path: the root of folders like bin/, share/, etc.
	e.g. /usr
Although I'm not sure why it exists...
@rodolforg
rodolforg force-pushed the please-use-gtk-application branch from a4df64d to e77d6be Compare January 29, 2022 12:59
@rodolforg
rodolforg force-pushed the please-use-gtk-application branch from e77d6be to 0db1342 Compare January 29, 2022 13:00
@rodolforg

Copy link
Copy Markdown
Contributor Author

Rebased!

@ice0
ice0 merged commit 61eba07 into synfig:master Jan 30, 2022
@ice0

ice0 commented Jan 30, 2022

Copy link
Copy Markdown
Collaborator

Merged. Thank you!

@rodolforg
rodolforg deleted the please-use-gtk-application branch January 30, 2022 12:38
rodolforg added a commit to rodolforg/synfig that referenced this pull request Jul 16, 2022
Steps to reproduce the problem:

1. Select Bline Tool
2. Change a parameter in Tool Options Panel (e.g. Opacity or Line Width)
3. Restart Synfig Studio
4. Select Bline Tool and see the change was not saved.

Reason:
Since synfig#2497, we finally use Gtk::Application as base class for `App`.
`App` is destructed before `MainWindow` is closed (basically at start).
So, stuff done on quitting before merging synfig#2497 was not done on the right time now.

As `signal-shutdown` is only called in primary instance of Gtk::Application,
it's the proper moment to delete and finish stuff on application exit.
ice0 pushed a commit that referenced this pull request Jul 22, 2022
Steps to reproduce the problem:

1. Select Bline Tool
2. Change a parameter in Tool Options Panel (e.g. Opacity or Line Width)
3. Restart Synfig Studio
4. Select Bline Tool and see the change was not saved.

Reason:
Since #2497, we finally use Gtk::Application as base class for `App`.
`App` is destructed before `MainWindow` is closed (basically at start).
So, stuff done on quitting before merging #2497 was not done on the right time now.

As `signal-shutdown` is only called in primary instance of Gtk::Application,
it's the proper moment to delete and finish stuff on application exit.
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.

3 participants