Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify prototypes for used X11 C functions #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jfilak
Copy link
Contributor

@jfilak jfilak commented Jul 29, 2015

No description provided.

Jakub Filak added 2 commits July 29, 2015 14:43
Python does not magically resolve types of C functions imported through
ctypes. Without specifying their prototypes the return type of all
functions is c_int and all Python int arguments are converted to C int
arguments.

The return type of XOpenDisplay is 'Display *', so the correct return type is
'c_void_p'.

The argument type of XCloseDisplay is 'Display *', so the correct
argument type is 'c_void_p' too.

Without this patch, the pointers returned from XOpenDisplay and passed
to XCloseDisplay are truncated to int, which is shorter than 'void *' on
some architectures, and that causes unpredicted behavior which leads to
a crash.

Related: bugzilla.redhat.com/1244261

Signed-off-by: Jakub Filak <jfilak@redhat.com>
@jfilak
Copy link
Contributor Author

jfilak commented Aug 24, 2015

I added a new commit related to https://bugzilla.redhat.com/show_bug.cgi?id=1194976

Jakub Filak added 5 commits August 24, 2015 10:23
The environment variable is not documented (or at least I cannot find any
official documentation), the environment variable is used by all major
Dekstop vendors though (just try to ask google to search for its name).

Related  rhbz#1194976

Signed-off-by: Jakub Filak <jfilak@redhat.com>
As suggested by PyGIWarning:

    /usr/lib/python3.4/site-packages/pyfros/controls.py:22: PyGIWarning:
    Gtk was imported without specifying a version first. Use
    gi.require_version('Gtk', '3.0') before import to ensure that the
    right version gets loaded.
          from gi.repository import Gtk

Signed-off-by: Jakub Filak <jfilak@redhat.com>
Related: rhbz#1197607, rhbz#1197997, rhbz#1199242

Signed-off-by: Jakub Filak <jfilak@redhat.com>
Related: rhbz#1228860

Signed-off-by: Jakub Filak <jfilak@redhat.com>
Related: rhbz#1248831

Signed-off-by: Jakub Filak <jfilak@redhat.com>
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.

None yet

1 participant