Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_viewport_decorated(False) does not work well with primary_window #1130

Closed
DataExplorerUser opened this issue Jul 31, 2021 · 9 comments · Fixed by #1992
Closed

set_viewport_decorated(False) does not work well with primary_window #1130

DataExplorerUser opened this issue Jul 31, 2021 · 9 comments · Fixed by #1992
Labels

Comments

@DataExplorerUser
Copy link
Contributor

Win 10, DPG 0.8.54

set_viewport_decorated(False) does not work well with primary_window. The code below results in the screenshot below. The primary window does not cover the entire viewport.

import dearpygui.dearpygui as dpg

dpg.setup_viewport()
dpg.set_viewport_height(400)
dpg.set_viewport_width(400)
dpg.set_viewport_decorated(False)

with dpg.window(label="tutorial") as main_window:
    dpg.add_button(label="Press me")
    dpg.add_text('............................................................................................................................................................')

dpg.set_primary_window(main_window, True)
dpg.start_dearpygui()

set_deco

@hoffstadt hoffstadt added the bug label Aug 2, 2021
@hoffstadt hoffstadt added type: bug bug priority: medium medium priority and removed bug labels Oct 13, 2021
@hoffstadt hoffstadt added the state: ready Fixed/Added and will be present in an upcoming release label Jan 4, 2022
@hoffstadt
Copy link
Owner

Fixed in next release.

@hoffstadt hoffstadt removed the state: ready Fixed/Added and will be present in an upcoming release label Jan 4, 2022
@eggaitech
Copy link

It is not fixed yet.

@hoffstadt
Copy link
Owner

Will recheck this!

@hoffstadt hoffstadt reopened this May 17, 2022
@Mstpyt
Copy link
Collaborator

Mstpyt commented Jul 11, 2022

V 1.6.2 Fixed;

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title='Custom Title', width=400, height=400, decorated=False)
dpg.setup_dearpygui()


with dpg.window(label="tutorial") as main_window:
    dpg.add_button(label="Press me")
    dpg.add_text('............................................................................................................................................................')

dpg.set_primary_window(main_window, True)
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Bug should be closed !

@my1e5
Copy link
Contributor

my1e5 commented Nov 29, 2022

There is still an issue with decorated=False and primary window on Windows 10 using DPG 1.8.0

import dearpygui.dearpygui as dpg
dpg.create_context()

with dpg.window() as primary_window:
    dpg.add_text("Hello World")

dpg.create_viewport(width=200, height=200, decorated=False, x_pos=500)
dpg.set_primary_window(primary_window, True)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Screenshot 2022-11-29 152053

Notice the thin gray border on the top and left edges of the viewport - which is not present on the bottom and right edges.

If you remove dpg.set_primary_window then the borders of the window are rendered consistently.

image

@Mstpyt
Copy link
Collaborator

Mstpyt commented Nov 30, 2022

Hey @my1e5

I can reproduce it and yes it isn't quite correct.
Should be fixed in the next release.

@Mstpyt
Copy link
Collaborator

Mstpyt commented Nov 30, 2022

Btw that is how it looks now:

grafik

grafik

So also verified with my own and pilots project, and it looks good to me

@v-ein
Copy link
Contributor

v-ein commented Jan 6, 2023

Not a big deal but I'd like to point out that the fix makes the if (viewport->decorated) condition useless:

			if (viewport->decorated)
			{
				GContext->viewport->clientHeight = cheight;
				GContext->viewport->clientWidth = cwidth;
			}
			else
			{
				GContext->viewport->clientHeight = cheight;
				GContext->viewport->clientWidth = cwidth;
			}

Since the if and else branches are identical, one could just get rid of the if statement.

@Mstpyt
Copy link
Collaborator

Mstpyt commented Jan 6, 2023

That is true ! Thanks for the hint !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants