GTK applications don't work anymore under unity8

Bug #1401968 reported by Sebastien Bacher
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qtmir (Ubuntu)
Fix Released
Critical
Gerry Boland

Bug Description

Using current vivid, GTK application don't render anymore. GTK didn't change and that was working earlier in the cycle...

step to reproduce:
- get a vivid install with unity8
- install a gtk application, e.g gedit
- edit /usr/share/applications/gedit.desktop and add X-Ubuntu-Touch=true
- log into unity8
- click on gedit in the dash

Note that the GTK backend works under the Mir test server

Log from the application contains

"gdk_mir_display_create_window_impl window=0x14b6240 location=(0, 0) size=(650, 500)
gdk_mir_window_impl_set_role window=0x14b6240
gdk_mir_window_impl_register_dnd window=0x14b6240
gdk_mir_display_request_selection_notification
gdk_mir_window_impl_register_dnd window=0x14b6240
gdk_mir_window_impl_register_dnd window=0x14b6240
gdk_mir_window_impl_register_dnd window=0x14b6240
gdk_mir_window_impl_set_title window=0x14b6240
gdk_mir_display_supports_selection_notification
gdk_mir_display_request_selection_notification
gdk_mir_window_impl_register_dnd window=0x14b6240
gdk_mir_window_impl_focus window=0x14b6240"

Tags: gtk-mir

Related branches

tags: added: gtk-mir
Gerry Boland (gerboland)
Changed in qtmir:
importance: Undecided → High
importance: High → Critical
Revision history for this message
Sebastien Bacher (seb128) wrote :

Downgrading qtmir to https://launchpad.net/ubuntu/+source/qtmir/0.4.4+15.04.20141124-0ubuntu1 makes e.g eog run, that suggest that the issue is with that component and not with mir or gtk

Revision history for this message
Sebastien Bacher (seb128) wrote :

(gedit seems to have issues there but testing with eog works)

Gerry Boland (gerboland)
Changed in qtmir:
status: New → Triaged
Changed in qtmir (Ubuntu):
status: New → Triaged
Revision history for this message
Gerry Boland (gerboland) wrote :

Seems the qmake->cmake transition broke this, digging into why

Revision history for this message
Gerry Boland (gerboland) wrote :

Update with what I've got so far. qmake->cmake change did cause this, mainly some subtlety with GL and GLES mixing has been broken.

Surprisingly If I build on desktop with -DUSE_OPENGLES=1, everything works! So some build configuration needs changing

Gerry Boland (gerboland)
Changed in qtmir:
assignee: nobody → Gerry Boland (gerboland)
Gerry Boland (gerboland)
Changed in qtmir:
status: Triaged → In Progress
Revision history for this message
Gerry Boland (gerboland) wrote :

Yeah, I'm puzzled. On desktop, configuring with -DUSE_OPENGLES=1 has everything working. Qt is compiled with GL support on desktop, so this fact confuses me. With that configure flag, Qt does notified it has a GLES context, perhaps it is smart enough to then just use the right shaders & commands. Or else MESA is being forgiving at switching between GL and GLES.

Comparing the apitrace of the old qmake build versus a newer cmake build, this is the main change:

- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0)
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2048, 1024, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL)
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA, 2048, 1024, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL)

Source of this line is the Scenegraph renderer:

void Atlas::bind(QSGTexture::Filtering filtering)

        glTexImage2D(GL_TEXTURE_2D, 0, m_internalFormat, m_size.width(), m_size.height(), 0, m_externalFormat, GL_UNSIGNED_BYTE, 0);

m_internalFormat is wrong after cmake change - it is GL_BGRA, which is the default if a non-GLES context is current.

I compared the build commands between qmake and cmake: http://pastebin.ubuntu.com/9699667/
which shows me that the newer cmake is setting QT_USING_OPENGL and QTMIR_USE_OPENGL (as we'd expect), but qmake was not setting these. qmake worked, perhaps by accident

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtmir - 0.4.4+15.04.20150206-0ubuntu1

---------------
qtmir (0.4.4+15.04.20150206-0ubuntu1) vivid; urgency=medium

  [ Gerry Boland ]
  * Explicitly setting GL-mode breaks GTK app rendering. Removing the
    hack appears to just work (LP: #1401968)

  [ Michał Sawicz ]
  * Add moot autopkgtest to run the standard unit tests

  [ Albert Astals Cid ]
  * Fix demo shell import name

  [ Daniel d'Andrada ]
  * Don't suspend&resume the main stage app when switching focus from
    side to main stage
 -- Ubuntu daily release <email address hidden> Fri, 06 Feb 2015 10:23:19 +0000

Changed in qtmir (Ubuntu):
status: Triaged → Fix Released
Changed in qtmir:
status: In Progress → Fix Released
Michał Sawicz (saviq)
Changed in qtmir (Ubuntu):
assignee: nobody → Gerry Boland (gerboland)
importance: Undecided → Critical
no longer affects: qtmir
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.