mirror of
https://github.com/greenshot/greenshot
synced 2025-07-15 01:23:47 -07:00
This commit is made due to BUG-1775. Although it might not fix it, it ensures that every window has an icon and only than when it loaded. Also added improved error handling.
This commit is contained in:
parent
eed5b66116
commit
7938ab5dad
29 changed files with 32 additions and 34 deletions
|
@ -967,7 +967,13 @@ namespace Greenshot.Helpers {
|
|||
//}
|
||||
|
||||
using (CaptureForm captureForm = new CaptureForm(_capture, _windows)) {
|
||||
DialogResult result = captureForm.ShowDialog();
|
||||
// Make sure the form is hidden after showing, even if an exception occurs, so all errors will be shown
|
||||
DialogResult result = DialogResult.Cancel;
|
||||
try {
|
||||
result = captureForm.ShowDialog(MainForm.Instance);
|
||||
} finally {
|
||||
captureForm.Hide();
|
||||
}
|
||||
if (result == DialogResult.OK) {
|
||||
_selectedCaptureWindow = captureForm.SelectedCaptureWindow;
|
||||
_captureRect = captureForm.CaptureRectangle;
|
||||
|
@ -975,11 +981,11 @@ namespace Greenshot.Helpers {
|
|||
if (_selectedCaptureWindow != null) {
|
||||
_capture.CaptureDetails.Title = _selectedCaptureWindow.Text;
|
||||
}
|
||||
|
||||
|
||||
if (_captureRect.Height > 0 && _captureRect.Width > 0) {
|
||||
// Take the captureRect, this already is specified as bitmap coordinates
|
||||
_capture.Crop(_captureRect);
|
||||
|
||||
|
||||
// save for re-capturing later and show recapture context menu option
|
||||
// Important here is that the location needs to be offsetted back to screen coordinates!
|
||||
Rectangle tmpRectangle = _captureRect;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue