fixed #7999 #7989: Workaround dialog issue

This commit is contained in:
Jaex 2025-06-29 23:31:10 +03:00
parent fd9618bec0
commit 184e749202
35 changed files with 32 additions and 27 deletions

View File

@ -161,12 +161,6 @@ namespace ShareX.HelpersLib
Suffix
}
public enum ScreenTearingTestMode
{
VerticalLines,
HorizontalLines
}
public enum HotkeyStatus
{
Registered,

View File

@ -474,5 +474,15 @@ namespace ShareX.HelpersLib
tabControl.SelectedTab = tabPage;
tabControl.Enabled = true;
}
public static DialogResult ShowDialogTopMost(this Form form, Form owner)
{
if (owner != null && owner.TopMost)
{
form.TopMost = true;
}
return form.ShowDialog(owner);
}
}
}

View File

@ -110,17 +110,12 @@ namespace ShareX.HelpersLib
{
using (ColorPickerForm dialog = new ColorPickerForm(currentColor, options: options))
{
if (owner != null && owner.TopMost)
{
dialog.TopMost = true;
}
if (openScreenColorPicker != null)
{
dialog.EnableScreenColorPickerButton(openScreenColorPicker);
}
if (dialog.ShowDialog(owner) == DialogResult.OK)
if (dialog.ShowDialogTopMost(owner) == DialogResult.OK)
{
newColor = dialog.NewColor;
return true;

View File

@ -201,6 +201,9 @@ namespace ShareX.ScreenCaptureLib
FormBorderStyle = FormBorderStyle.None;
Bounds = ScreenBounds;
ShowInTaskbar = false;
#if !DEBUG
TopMost = true;
#endif
}
else
{

View File

@ -84,7 +84,7 @@ namespace ShareX.ScreenCaptureLib
{
using (StickerForm stickerForm = new StickerForm(AnnotationOptions.StickerPacks, AnnotationOptions.SelectedStickerPack, AnnotationOptions.StickerSize))
{
if (stickerForm.ShowDialog(Manager.Form) == DialogResult.OK)
if (stickerForm.ShowDialogTopMost(Manager.Form) == DialogResult.OK)
{
AnnotationOptions.SelectedStickerPack = stickerForm.SelectedStickerPack;
AnnotationOptions.StickerSize = stickerForm.StickerSize;

View File

@ -142,7 +142,7 @@ namespace ShareX.ScreenCaptureLib
using (TextDrawingInputBox inputBox = new TextDrawingInputBox(Text, TextOptions, SupportGradient, Manager.Options.ColorPickerOptions))
{
result = inputBox.ShowDialog(Manager.Form) == DialogResult.OK;
result = inputBox.ShowDialogTopMost(Manager.Form) == DialogResult.OK;
Text = inputBox.InputText;
OnConfigSave();
}

View File

@ -393,6 +393,12 @@ namespace ShareX
Default, Light, Transparent
}
public enum ScreenTearingTestMode
{
VerticalLines,
HorizontalLines
}
#if !MicrosoftStore
public enum StartupState
{

View File

@ -1,4 +1,4 @@
namespace ShareX.HelpersLib
namespace ShareX
{
partial class MonitorTestForm
{
@ -31,8 +31,8 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MonitorTestForm));
pSettings = new System.Windows.Forms.Panel();
btnScreenTearingTest = new System.Windows.Forms.Button();
btnGradientColor2 = new ColorButton();
btnGradientColor1 = new ColorButton();
btnGradientColor2 = new HelpersLib.ColorButton();
btnGradientColor1 = new HelpersLib.ColorButton();
lblTip = new System.Windows.Forms.Label();
cbGradient = new System.Windows.Forms.ComboBox();
rbGradient = new System.Windows.Forms.RadioButton();
@ -322,8 +322,8 @@
private System.Windows.Forms.ComboBox cbGradient;
private System.Windows.Forms.RadioButton rbGradient;
private System.Windows.Forms.Label lblTip;
private ColorButton btnGradientColor2;
private ColorButton btnGradientColor1;
private HelpersLib.ColorButton btnGradientColor2;
private HelpersLib.ColorButton btnGradientColor1;
private System.Windows.Forms.Button btnScreenTearingTest;
}
}

View File

@ -23,12 +23,13 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace ShareX.HelpersLib
namespace ShareX
{
public partial class MonitorTestForm : Form
{

View File

@ -336,12 +336,7 @@ namespace ShareX
using (PinToScreenOptionsForm pinToScreenOptionsForm = new PinToScreenOptionsForm(Options))
{
if (TopMost)
{
pinToScreenOptionsForm.TopMost = true;
}
if (pinToScreenOptionsForm.ShowDialog(this) == DialogResult.OK)
if (pinToScreenOptionsForm.ShowDialogTopMost(this) == DialogResult.OK)
{
if (TopMost != Options.TopMost)
{

View File

@ -23,13 +23,14 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace ShareX.HelpersLib
namespace ShareX
{
public class ScreenTearingTestForm : Form
{