yglukhov / nimx

GUI library
MIT License
1.09k stars 75 forks source link

Example Freezes #236

Closed bitnom closed 7 years ago

bitnom commented 7 years ago

I run the example in the README and I get: http://storage3.static.itmages.com/i/17/0620/h_1497922783_2406791_1132230b22.png

yglukhov commented 7 years ago

@TomAshley303, judging from the screenshot, it's a mix of macos and linux environment? Could you please elaborate on your configuration? Can you please confirm that other SDL2 software works properly in your environment?

bitnom commented 7 years ago

It's Kubuntu. 17.04 Just running the example from the readme. latest nim 0.17. idk about SDL2. I'm running KDE5/plasma.

bitnom commented 7 years ago

This continues to happen. I'm on a different version of Linux now (KDE Neon) which is Ubuntu 16.04 with KDE 5.10.4. If I resize the window, it displays as normal until it loses focus in which case the focused window contents get frozen onto the nimx window. This is a fresh install. To get nimx to work, I installed the libsdl2-2.0-0 package and ran ln -s /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 /usr/lib/x86_64-linux-gnu/libSDL2.so.

using this code:

import nimx.window
import nimx.text_field
import nimx.system_logger # Required because of Nim bug (#4433)

proc startApp() =
    # First create a window. Window is the root of view hierarchy.
    var wnd = newWindow(newRect(40, 40, 800, 600))

    # Create a static text field and add it to view hierarchy
    let label = newLabel(newRect(20, 20, 150, 20))
    label.text = "Hello, world!"
    wnd.addSubview(label)

# Run the app
runApplication:
    startApp()
yglukhov commented 7 years ago

@TomAshley303 i've never seen such behavior with nimx, and have no idea how to fix it. I would suspect either hardware or specific software environment problem. So you're on your own here for now. As a start I would recommend you write a small sdl program in c and see how it works in your case.

Jipok commented 7 years ago

I have a similar problem with example from readme. Just minimize and then maximize the window. image Asus laptop with Intel Core i3 4010U OS: Manjaro 17.0.2 Linux 4.12.3-1 DE: xfce4 4.12.4-1 Nim Compiler Version 0.17.1 (2017-07-25) [Linux: amd64] gcc 7.1.1 20170630

Jipok commented 7 years ago

Tested in another environment. Cinnamon 3.4.3-1. Works without problems. Openbox 3.6.1-3. Same as in xfce4. But sometimes it crashes after maximization (Look at the terminal output) https://user-images.githubusercontent.com/25588359/28794755-d735a9e4-7650-11e7-9126-2389686489e8.png

yglukhov commented 7 years ago

Could you please retest with latest #253 fix?

yglukhov commented 7 years ago

Please reopen if still reproduces.