BOSSoNe0013 / track-o-bot

The friendly Hearthstone Tracker (Linux port)
https://trackobot.com
GNU Lesser General Public License v2.1
39 stars 6 forks source link

capture-rewrite not working with unity (compiz) #64

Closed lgraf closed 8 years ago

lgraf commented 8 years ago

When i use the latest revision (3d9584e), tracking of games has stopped working for me. I use a mostly plain ubuntu 16.04 with unity/compiz.

When i start hearthstone and inspect the debug log i don't see any message about hearthstone is starting and no log messages are following. Not sure about the root cause, but it seams that the state detection is already broken.

When i revert to de92497, track-o-bot works again. (log message about starting, capturing, uploading, etc.).

Thanks for the great work! Luca

angrylinuxuser commented 8 years ago

are you by any chance using multimonitor setup?

lgraf commented 8 years ago

No, running it on a lenovo t440, no external display is used.

BOSSoNe0013 commented 8 years ago

Same problem here @angrylinuxuser on plasma desktop Kubuntu 16.04 with multi-monitor setup.

angrylinuxuser commented 8 years ago

Could you test if f27a8d1f08b60c357fd626292baee4fb0afe75f7 is at fault here or the next one? In vm it tracks games for me but i have to install ubuntu on metal to test screen capture cuz 2fps hs in vm is a disaster. On archlinux its working fine. ( multimonitor might be broken for rank detection if hs is not on a main monitor but it was broken before i think. I have a code to fix rank detection for MM but i have to rewrite it )

lgraf commented 8 years ago

Tested with f27a8d1 and capturing is not working.

angrylinuxuser commented 8 years ago

Something must be going on ill try to figue it out cuz on my first run i had problems with capture info not showing up in log but after a restart: zrzut ekranu z 2016-06-20 21-32-32 everything works. Ill make code more verbose to se whats going on.

lgraf commented 8 years ago

If i can support you with debugging/testing under ubuntu, just let me know. Thank you for looking into this!

angrylinuxuser commented 8 years ago

could you try this branch https://github.com/angrylinuxuser/track-o-bot/tree/no-capture-fix ?

angrylinuxuser commented 8 years ago

Ok, now im not able to reproduce it under ubuntu. I think my initial problem was related to hastening thru installation of hs and not restarting it after configuration of tob.

Could You please try using tob from the branch above? It is more verbose. Also could You please enable debug mode if disabled. Is your hs full-screen or windowed ( if full-screen try using windowed to see if three are any changes ) And please play 5-6 round in adventure ( no matter what ) and upload a log file from ~/.local/share/spidy.ch/Track-o-Bot/Track-o-Bot.log ( take out your account name from it if its there).

@BOSSoNe0013 MM works fine and it did by the looks of things. Again i was trying to fix something that wasn't broken.

One thing that what i would like to fix is that the only valid pixmaps that rank detection gets are those that are grabbed when window isn't obstructed or minimized but that requires looking at composite extension.

BOSSoNe0013 commented 8 years ago

I'm using this branch and tracking does not work and nothing is displayed in the console after login information.

angrylinuxuser commented 8 years ago

Do you have qtcreator isntalled with gdb? If yes could you put a breakpoint at Hearthstone::Update and LinuxWindowCapture::WindowFound and step thru there?

BOSSoNe0013 commented 8 years ago

This test does not pass in LinuxWindowCapture::FindWindow if( !qstrcmp( wmNameR.class_name, windowClass.toStdString().c_str() ) && !qstrcmp( wmNameR.instance_name, instanceName.toStdString().c_str() ) ) {

angrylinuxuser commented 8 years ago

Now we are onto something. Can you xprop Hearthstone window and tell me WM_CLASS? Mine looks like WM_CLASS(STRING) = "Hearthstone.exe", "Wine"

BOSSoNe0013 commented 8 years ago

WM_CLASS(STRING) = "Hearthstone.exe", "Hearthstone.exe" That's it !

angrylinuxuser commented 8 years ago

Do you use wine from official repo or the one from play on linux. We have to figure out now if the instance name is enough or do we need checks for class Im running on ubuntu the one from playonlinux but ill check now the official one

BOSSoNe0013 commented 8 years ago

i'm using wine-1.9.7 (Staging)

BOSSoNe0013 commented 8 years ago

I've tested by replacing && by || and all is working, event rank detection. I think that instance name is enough.

angrylinuxuser commented 8 years ago

Ok:) commit that fix:) ill rewrite a litle linuxwidowcapture with QScopedPointer to reduce the number of spaghetti if else code. then ill try to use composite extension to grap pixmaps of windows hidden ( but that will take a while since i dont know much about it :)

BOSSoNe0013 commented 8 years ago

Done

lgraf commented 8 years ago

Just did some smoke test with the current master and logging about starting, capturing appeared again. Looks good!