config: limit resource set acquisition to non-system surfaces.
authorJan Ekström <jan.ekstrom@intel.com>
Fri, 14 Nov 2014 09:18:42 +0000 (11:18 +0200)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Thu, 8 Jan 2015 16:37:19 +0000 (18:37 +0200)
System surfaces have no resource sets, so trying to acquire them
leads to them just being not found and spamming the log with
error-like messages. Also generally move definition of locals to
the beginning of the block.

Change-Id: Idf553cc44ce5b84c3b002087164d6e7f4700dcb9

packaging.in/murphy.lua

index 08b6225..6ca1b46 100644 (file)
@@ -1721,7 +1721,14 @@ if sc then
             local lower_mask = 0x02000000
             local nores_mask = 0x40000000
             local time_mask  = 0x00ffffff
+
+            local surface        = msg.arg.surface
+            local system_surface = false
+            local appdb          = wmgr:application(msg.appid)
+            system_surface       = appdb.privileges.screen == "system"
+
             msg.arg.visible = 1
+
             if msg.arg then
                 local time = 200
                 if  msg.arg.anim_time then
@@ -1741,26 +1748,27 @@ if sc then
                     print('time: ' .. tostring(time))
                 end
             end
-            if not nores then
-                local p = wmgr:application(msg.appid)
-                local s = p.privileges.screen
-                if s == "system" then
-                    nores = true
-                    if not msg.arg.raise then
-                        msg.arg.raise = 1
-                    end
+
+            -- all show messages from system surfaces are forced
+            if not nores and system_surface then
+                nores = true
+                if not msg.arg.raise then
+                    msg.arg.raise = 1
                 end
             end
+
             if verbose > 2 then
                 print('### ==> SHOW')
-                print(tostring(msg.arg))
+                print(tostring(msg.arg) .. ", system_surface=" .. tostring(system_surface))
             end
 
-            local surface = msg.arg.surface
-
             if nores then
                 wmgr:window_request(msg.arg, a, 0)
-                resclnt:resource_set_acquire("screen", surface)
+
+                -- only non-system surfaces have resource sets
+                if not system_surface then
+                    resclnt:resource_set_acquire("screen", surface)
+                end
             else
                 resclnt:resource_set_acquire("screen", surface)
                 resmgr:window_raise(msg.appid, surface, 1)