From 78592468fe75f09299e12d8a8fbb94635a2befd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Wed, 5 Dec 2018 00:37:10 +0100 Subject: [PATCH] divers --- .gitignore | 1 + Crow.csproj | 3 ++- Crow.sln | 1 + Properties/AssemblyInfo.cs | 2 +- Templates/DockWindow.template | 11 +++++++---- src/Gradient.cs | 5 ++++- src/GraphicObjects/PrivateContainer.cs | 4 +++- src/Interface.cs | 7 +++---- src/backends/xlib/XLibBackend.cs | 4 ++-- 9 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 477bac00..2f5de094 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ Crow.userprefs Debug packages *.nupkg +*.user /GOLib.suo /tmp /bin/* diff --git a/Crow.csproj b/Crow.csproj index 0afb1db9..f181f154 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -32,7 +32,7 @@ true false $(SolutionDir)build\Debug - DEBUG_DRAGNDROP0;DEBUG_LOG0;XLIB_BACKEND0;DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0 + DEBUG_DRAGNDROP0;DEBUG_LOG;XLIB_BACKEND0;DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0 @@ -235,6 +235,7 @@ + diff --git a/Crow.sln b/Crow.sln index 64088c26..dc694b6b 100644 --- a/Crow.sln +++ b/Crow.sln @@ -18,6 +18,7 @@ Global {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.Build.0 = Release|Any CPU {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.Build.0 = Release|Any CPU {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 3e2b7331..a799c754 100755 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Runtime.CompilerServices; // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("crow.key")] +//[assembly: AssemblyKeyFile("crow.key")] diff --git a/Templates/DockWindow.template b/Templates/DockWindow.template index f407502a..b293e536 100755 --- a/Templates/DockWindow.template +++ b/Templates/DockWindow.template @@ -5,11 +5,14 @@ MouseEnter="./onBorderMouseEnter" MouseLeave="./onBorderMouseLeave"> - + @@ -23,6 +26,6 @@ - + diff --git a/src/Gradient.cs b/src/Gradient.cs index 0806e885..2630c42a 100644 --- a/src/Gradient.cs +++ b/src/Gradient.cs @@ -96,8 +96,11 @@ namespace Crow throw new NotImplementedException (); } - foreach (ColorStop cs in Stops) + foreach (ColorStop cs in Stops) { + if (cs == null) + continue; grad.AddColorStop (cs.Offset, cs.Color); + } ctx.SetSource (grad); grad.Dispose (); diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs index 41918bc8..0f9b0c59 100644 --- a/src/GraphicObjects/PrivateContainer.cs +++ b/src/GraphicObjects/PrivateContainer.cs @@ -51,7 +51,9 @@ namespace Crow go = null; if (base.FindByDesignID (designID, out go)) return true; - return (bool)child?.FindByDesignID (designID, out go); + if (child == null) + return false; + return child.FindByDesignID (designID, out go); } #endif protected GraphicObject child; diff --git a/src/Interface.cs b/src/Interface.cs index 3c586685..f2d6a1ce 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -129,8 +129,8 @@ namespace Crow Keyboard.KeyUp += Keyboard_KeyUp; Keyboard.KeyPress += Keyboard_KeyPress; - //initTooltip (); - //initContextMenus (); + initTooltip (); + initContextMenus (); running = true; @@ -173,8 +173,7 @@ namespace Crow { while (running) { Update (); - - Thread.Sleep (1); + Thread.Sleep (5); } } diff --git a/src/backends/xlib/XLibBackend.cs b/src/backends/xlib/XLibBackend.cs index 81500c03..a123e204 100644 --- a/src/backends/xlib/XLibBackend.cs +++ b/src/backends/xlib/XLibBackend.cs @@ -35,9 +35,9 @@ namespace Crow.XLib [DllImportAttribute("X11")] static extern int XInitThreads(); [DllImportAttribute("X11")] - static extern IntPtr XOpenDisplay(IntPtr displayName); + internal static extern IntPtr XOpenDisplay(IntPtr displayName); [DllImportAttribute("X11")] - static extern IntPtr XCloseDisplay(IntPtr disp); + internal static extern IntPtr XCloseDisplay(IntPtr disp); [DllImportAttribute("X11")] static extern Int32 XDefaultScreen(IntPtr disp); [DllImportAttribute("X11")] -- 2.47.3