Bug 176 - Null-References and wrong values in Gdk.Global.WindowManagerClientWindows
Summary: Null-References and wrong values in Gdk.Global.WindowManagerClientWindows
Status: RESOLVED FIXED
Alias: None
Product: Gtk#
Classification: Mono
Component: gtk-sharp ()
Version: 2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-08-04 08:02 UTC by Nicolas Pöhlmann
Modified: 2016-05-10 01:59 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Patch howto resolve the bug (435 bytes, patch)
2011-08-04 08:02 UTC, Nicolas Pöhlmann
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Nicolas Pöhlmann 2011-08-04 08:02:00 UTC
Created attachment 66 [details]
Patch howto resolve the bug

The function Gdk.Global.WindowManagerClientWindows returns false references.

The problem is located in gdk/Global.custom which uses the wrong IntPtr.Size to
return the window(s).

Reproducible: Always

Steps to Reproduce:
C#-Code:
foreach (Gdk.Window win in Gdk.Global.WindowManagerClientWindows)
{
    if (win != null )
    {        
        Console.Writeline("OK");        
    } else {        
        Console.Writeline("Wrong/Error");        
    }    
}

Actual Results:  
The function Gdk.Global.WindowManagerClientWindows returns only every second
window and after the third one, it only returns null-references.

Expected Results:  
Just get the references of all running Gdk-Windows.

The patch solved the problem for me on and all gdk-windows are now returned
correctly.
Comment 1 Jeffrey Stedfast 2011-08-05 16:10:50 UTC
Is this on 64bit?
Comment 2 Nicolas Pöhlmann 2011-08-05 18:48:05 UTC
yes it's on 64bit platform, tested on gentoo and fedora
Comment 3 Antonius Riha 2014-09-07 08:44:13 UTC
I've opened a pull request with a fix for this issue: https://github.com/mono/gtk-sharp/pull/117
Comment 4 Marius Ungureanu 2016-04-17 19:24:33 UTC
Fixed as the pull request is merged now.
Comment 5 Andres G. Aragoneses 2016-05-10 01:59:54 UTC
Antonius: can you forward port the fix to master branch?