View Issue Details

IDProjectCategoryView StatusLast Update
0004091Spring engineGeneralpublic2013-11-20 19:53
Reporterabma Assigned ToKloot  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version94.1.1+git 
Target Version96.0 
Summary0004091: function gadget:MousePress() doesn't gets called when LoadingMT = 0
Descriptionend game widget on windows works but doesn't on linux
Steps To Reproducestart ba, self-d com

click "quit"

on windows game quiets, on linux nothing happens. hover effect works, so i guess something goes wrong with the click event.
TagsNo tags attached.
Attached Files
infolog_singlethreadloading.txt (Attachment missing)
infolog_mtloading.txt (Attachment missing)
Checked infolog.txt for Errors

Relationships

parent of 0004139 closedKloot Hang on Stats Windows in the end of the Game 

Activities

abma

2013-10-28 17:11

administrator   ~0011881

bug exists already in 94.1

Kloot

2013-10-28 17:18

developer   ~0011882

it works for me

abma

2013-10-28 17:18

administrator   ~0011883

Last edited: 2013-10-28 17:19

similar problem exists in kernel panic, when starting a mission a question is shown:

"This is the first time you run Kernel Panic Would you like me to set Spring Settings?"

hover effect works, but clicking doesn't work.

http://uptiki.altervista.org/viewer.php?file=pt1dcvhc7maswm8oh0qp.png

not sure why the "normal" menu of KP works, but this one doesn't.

abma

2013-10-28 19:26

administrator   ~0011884

maybe ubuntu related. heard from an other (l)ubuntu user, that he had this problem as well. for me it works on windows, too.

silentwings

2013-10-28 19:31

reporter   ~0011885

are you clicking quit from springs usual menu or from the awards gadget button?

abma

2013-10-28 19:31

administrator   ~0011886

awards gadget

abma

2013-10-28 19:37

administrator   ~0011887

adding an assert(false) here:
https://github.com/spring/spring/blob/develop/rts/Game/UI/MouseHandler.cpp#L336

gets triggered... shouldn't the mouseclick be handled by luaInputReceiver ?

abma

2013-10-28 20:20

administrator   ~0011888

function gadget:MousePress(x,y,button)

doesn't gets called at all

function widget:MousePress(x,y,button)

works... ideas?!

silentwings

2013-10-28 21:27

reporter   ~0011890

umm, for me it works and i can't see anything wrong in my code, i have heard this doesn't work for a few others too but no idea why not

you could try using the ba svn as a .sdd and edit the gadget code to find out what gets called and what isn't. the only code involved is a simple check in MousePress to see if game is over and if press was on the 'quit' button, if so it does Spring.SendCommands("quitforce")

abma

2013-10-28 21:28

administrator   ~0011891

as written, function gadget:MousePress(x,y,button) doesn't gets called at all in the gadget.

abma

2013-10-29 19:51

administrator   ~0011892

Last edited: 2013-10-29 20:25

@kloot:

an idea what could be the cause? is there a config setting or so which could influence this?

clicks are correctly detected, else the widget wouldn't show it, no clue why no MouseClick arrives at the gadget...

compile setting maybe?


edit: no 94.1 release build has this bug, too.

Kloot

2013-10-29 21:51

developer   ~0011898

gadget:MousePress events are filtered by ModUICtrl (see 0003280 and 0003954 for other examples), set LuaModUICtrl=1 in springrc.

abma

2013-10-29 23:32

administrator   ~0011900

Last edited: 2013-10-29 23:32

LuaModUICtrl=1 is/was already set...

silentwings

2013-10-30 00:45

reporter   ~0011903

Last edited: 2013-10-30 00:56

Yeah this isn't moduictrl related - people who try and play BA without moduictrl run into much more serious problems than this (deliberately, because we have an afk-detection system that relies on moduictrl).

Quite a few people have had this issue (unfortunately never me so I can't debug it easily) and I've no idea why. Do other gadgets pick up mouse presses for you?

abma

2013-11-11 15:59

administrator   ~0012063

i don't think so, as a lua widget gets the mouseclick event...

jK

2013-11-11 16:14

developer   ~0012066

gadgets don't recv mouse events
open a feature request

and no there is no diff between linux & windows

abma

2013-11-11 16:31

administrator   ~0012067

hu, why it works on windows then?

abma

2013-11-11 16:33

administrator   ~0012068

Last edited: 2013-11-11 16:33

works on win:
http://imolarpg.dyndns.org/trac/balatest/browser/trunk/luarules/gadgets/gui_awards.lua#L514

but doesn't on linux. then the bug is, that it shouldn't work on windows.

Kloot

2013-11-11 18:07

developer   ~0012069

Last edited: 2013-11-11 18:08

"but doesn't on linux"

yes it does (for me)

gadgets *do* get mouse events on the unsynced side...

abma

2013-11-11 18:17

administrator   ~0012070

then it would be interesting why it doesn't work for me and some others? :-|

ideas?

jK

2013-11-11 18:53

developer   ~0012073

Cause a widget caught the event.

Kloot

2013-11-11 18:55

developer   ~0012074

Last edited: 2013-11-11 18:57

Add some debugging printf's to EventHandler::MousePress and LuaHandle::MousePress, then check if the latter gets called / reaches the "RunCallInUnsynced" line. Do /luaui disable to rule out a local widget consuming the event.

abma

2013-11-12 00:56

administrator   ~0012082

Last edited: 2013-11-12 00:56

it reaches this line when trying to click quit when luaui is enabled & all widgets disabled:
https://github.com/spring/spring/blob/develop/rts/Lua/LuaHandle.cpp#L2388

also i've a debug printf in the gadget:MousePress(), so it doesn't get called at all?

what could be wrong when registering the gadget:MousePress callin?

with /luaui disable only "CEventHandler::MousePress" gets called, CLuaHandle::MousePress isn't called at all.

Kloot

2013-11-12 02:24

developer   ~0012085

Last edited: 2013-11-12 02:33

In gadgetHandler:MousePress, check which gadgets are being iterated over with:

function gadgetHandler:MousePress(x, y, button)
  local mo = self.mouseOwner
  print("GH:MousePress: " .. #self.MousePressList .. " gadgets, owner " .. tostring(mo))
  ...
  for _,g in ipairs(self.MousePressList) do
    print('\t' .. g.ghInfo.name)
  ...

abma

2013-11-12 05:34

administrator   ~0012087

Last edited: 2013-11-12 05:39

WTF?

LoadingMT = 0 -> doesn't work
LoadingMT = 1 -> works

can anyone reproduce this?

i can only test LoadingMT=1 on windows as LoadingMT=1 on linux crashes spring.

cleanrock

2013-11-13 17:31

reporter   ~0012102

LoadingMT=0 for me on 95.0.1-36-gacf76ee develop & Linux breaks Quit button in BA 7.84 Awards dialog, i.e. hover works but not clicking it.

Kloot

2013-11-13 17:45

developer   ~0012103

LoadingMT=1 used to crash (on my box) but no longer does.

For me enabling or disabling it makes no difference, MousePress events are registered normally in both cases.

abma

2013-11-13 17:49

administrator   ~0012104

Last edited: 2013-11-13 18:34

> In gadgetHandler:MousePress, check which gadgets are being iterated over with:

none, no output at all is written.

silentwings

2013-11-13 18:27

reporter   ~0012107

Last edited: 2013-11-13 22:05

I got [LOeT]Brenner, who also has this bug, to test it. He is a win7 user and he couldnt click the quit button LoadingMT = 0 or 1.

abma

2013-11-13 18:34

administrator   ~0012108

@silentwings: can you reproduce it, too?

silentwings

2013-11-13 21:49

reporter   ~0012113

Last edited: 2013-11-13 22:04

Yes, I could reproduce this when i set loadingmt=0.

abma

2013-11-13 22:05

administrator   ~0012114

Last edited: 2013-11-13 22:44

ok, thanks. Kloot how do/did you test it?

Kloot

2013-11-13 23:05

developer   ~0012122

1) set loadingMT=0 in .springrc
2) pick any recent (short) BA demo from replays.admin-box.com
3) watch to end until award-gadget screen comes up, click quit
4) repeat from 1) but with loadingMT=1

abma

2013-11-13 23:39

administrator   ~0012123

case is wrong: "loadingMT"

please try this then:

start spring, edit settings -> set LoadingMT = 0

quit spring
start spring, select BA 7.84
select commanders only & some small map
"test game"

self-destroy commander -> award screen will open.

Kloot

2013-11-14 00:04

developer   ~0012125

actually I already used the correct case in springrc ("LoadingMT" with capital L as LoadScreen.cpp expects)

with that test I can reproduce it, LoadingMT=0 fails while LoadingMT=1 works

Kloot

2013-11-14 03:50

developer   ~0012129

Last edited: 2013-11-14 03:51

with LoadingMT=0, LuaRules for some reason is *not* added as a client to EventHandler::listMousePress --> LuaHandle::WantsEvent returns false --> LuaHandleSynced::HasCallIn returns false

adding

  SetupUnsyncedFunction(L, "MousePress")

to the "if (!SetupUnsyncedFunction(...) || ...) { KillLua() ... }" chain in LuaHandleSynced::Init fixes it but I am pretty sure that should *not* be necessary since the fact LoadingMT=1 does work suggests an initialisation order issue

cba to investigate further atm

zwzsg

2013-11-19 02:54

reporter   ~0012177

> not sure why the "normal" menu of KP works, but this one doesn't.

- Normal menu is a widget
- What you saw is the gadget menu

Because a long time ago, LuaUI was off by default, so I made a gadget to switch LuaUI on, and asking the user first to be more polite.

And yes, it fails when LoadingMT = 0
It makes a very annoying button that you can't click!

As I posted on http://springrts.com/phpbb/viewtopic.php?f=11&t=30338
On forum and not on mantis because it wasn't clear if it was an engine bug initially.

Issue History

Date Modified Username Field Change
2013-10-28 17:11 abma New Issue
2013-10-28 17:11 abma Note Added: 0011881
2013-10-28 17:15 abma Steps to Reproduce Updated
2013-10-28 17:18 Kloot Note Added: 0011882
2013-10-28 17:18 abma Note Added: 0011883
2013-10-28 17:19 abma Note Edited: 0011883
2013-10-28 19:26 abma Note Added: 0011884
2013-10-28 19:26 abma Assigned To => abma
2013-10-28 19:26 abma Status new => feedback
2013-10-28 19:31 silentwings Note Added: 0011885
2013-10-28 19:31 abma Note Added: 0011886
2013-10-28 19:31 abma Status feedback => assigned
2013-10-28 19:37 abma Note Added: 0011887
2013-10-28 20:20 abma Note Added: 0011888
2013-10-28 21:27 silentwings Note Added: 0011890
2013-10-28 21:28 abma Note Added: 0011891
2013-10-28 21:28 abma Assigned To abma =>
2013-10-28 21:28 abma Status assigned => new
2013-10-29 00:45 abma Summary mouse click/events on windows / linux seems to differ => function gadget:MousePress() doesn't gets called on linux (ubuntu?!)
2013-10-29 19:51 abma Note Added: 0011892
2013-10-29 19:51 abma Status new => feedback
2013-10-29 19:52 abma Note Edited: 0011892
2013-10-29 20:25 abma Note Edited: 0011892
2013-10-29 21:51 Kloot Note Added: 0011898
2013-10-29 23:32 abma Note Added: 0011900
2013-10-29 23:32 abma Status feedback => new
2013-10-29 23:32 abma Note Edited: 0011900
2013-10-30 00:45 silentwings Note Added: 0011903
2013-10-30 00:49 silentwings Note Edited: 0011903
2013-10-30 00:56 silentwings Note Edited: 0011903
2013-11-11 15:59 abma Note Added: 0012063
2013-11-11 16:14 jK Note Added: 0012066
2013-11-11 16:14 jK Status new => closed
2013-11-11 16:14 jK Assigned To => jK
2013-11-11 16:14 jK Resolution open => no change required
2013-11-11 16:31 abma Note Added: 0012067
2013-11-11 16:33 abma Note Added: 0012068
2013-11-11 16:33 abma Assigned To jK =>
2013-11-11 16:33 abma Status closed => new
2013-11-11 16:33 abma Note Edited: 0012068
2013-11-11 18:07 Kloot Note Added: 0012069
2013-11-11 18:08 Kloot Note Edited: 0012069
2013-11-11 18:17 abma Note Added: 0012070
2013-11-11 18:53 jK Note Added: 0012073
2013-11-11 18:55 Kloot Note Added: 0012074
2013-11-11 18:57 Kloot Note Edited: 0012074
2013-11-12 00:56 abma Note Added: 0012082
2013-11-12 00:56 abma Note Edited: 0012082
2013-11-12 00:56 abma Note Edited: 0012082
2013-11-12 02:24 Kloot Note Added: 0012085
2013-11-12 02:33 Kloot Note Edited: 0012085
2013-11-12 05:34 abma Note Added: 0012087
2013-11-12 05:34 abma Note Edited: 0012087
2013-11-12 05:37 abma Target Version => 96.0
2013-11-12 05:38 abma Summary function gadget:MousePress() doesn't gets called on linux (ubuntu?!) => function gadget:MousePress() doesn't gets called when LoadingMT = 0
2013-11-12 05:39 abma Note Edited: 0012087
2013-11-12 05:41 abma File Added: infolog_singlethreadloading.txt
2013-11-12 05:43 abma File Added: infolog_mtloading.txt
2013-11-13 17:31 cleanrock Note Added: 0012102
2013-11-13 17:45 Kloot Note Added: 0012103
2013-11-13 17:49 abma Note Added: 0012104
2013-11-13 18:27 silentwings Note Added: 0012107
2013-11-13 18:34 abma Note Edited: 0012104
2013-11-13 18:34 abma Note Added: 0012108
2013-11-13 21:49 silentwings Note Added: 0012113
2013-11-13 21:50 silentwings Note Edited: 0012113
2013-11-13 22:04 silentwings Note Edited: 0012113
2013-11-13 22:05 silentwings Note Edited: 0012107
2013-11-13 22:05 abma Note Added: 0012114
2013-11-13 22:39 abma Assigned To => abma
2013-11-13 22:39 abma Status new => feedback
2013-11-13 22:44 abma Note Edited: 0012114
2013-11-13 23:05 Kloot Note Added: 0012122
2013-11-13 23:39 abma Note Added: 0012123
2013-11-13 23:39 abma Status feedback => assigned
2013-11-14 00:04 Kloot Note Added: 0012125
2013-11-14 00:13 abma Assigned To abma =>
2013-11-14 00:13 abma Status assigned => new
2013-11-14 03:50 Kloot Note Added: 0012129
2013-11-14 03:51 Kloot Note Edited: 0012129
2013-11-19 02:54 zwzsg Note Added: 0012177
2013-11-19 05:47 abma Relationship added parent of 0004139
2013-11-20 19:53 Kloot Changeset attached => spring develop e84a142a
2013-11-20 19:53 Kloot Assigned To => Kloot
2013-11-20 19:53 Kloot Status new => resolved
2013-11-20 19:53 Kloot Resolution no change required => fixed