Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-16428

Suspicious use of xim_create_callback which should probably be xim_destroy_callback

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.7.1
    • Other
    • None

    Description

      In the file src/gui/inputmethod/qximinputcontext_x11.cpp at line 478, it looks like the wrong callback function is passed as the fifth parameter to XUnregisterIMInstantiateCallback. Shouldn't it be xim_destroy_callback, not xim_create_callback? If this is true, however, the issue described in QTBUG-16404 then means that there is a secondary bug here as well in that xim_destroy_callback is also used on line 437 but that usage would be incompatible with passing xim_destroy_callback to XUnregisterIMInstantiateCallback. This is because xim_destroy_callback really should be of type XIDProc, not XIMProc, but on line 437 of qsiminputcontext_x11.cpp it needs to be XIMProc for it to be assignable to the callback member of the XIMCallback struct "destroy". The XIMCallback struct is not subject to the same confusion over parameter types that XUnregisterIMInstantiateCallback is as described in QTBUG-16404, meaning that the definition for XIMCallback in the LSB X11/Xlib.h header matches both the Xlib spec and common usage on various linux platforms (that I could check anyway). The only way out of it that I can see is to create another function with the same implementation as xim_destroy_callback but taking a XIDProc* parameter instead of XIMProc*. The implementation ignores this parameter anyway, so the resultant functionality should be the same as now but without the reliance on an incorrect implementation. The benefit gained by making this change is that Qt will then build with LSB compilers.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            earthdomain Earth Domain (Inactive)
            jirauser11888 user-aa151 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes