Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
yad
Commits
39c0805c
Commit
39c0805c
authored
5 years ago
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move checking for x11 to runtime
parent
e8e4b1dc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
main.c
src/main.c
+16
-10
No files found.
src/main.c
View file @
39c0805c
...
...
@@ -48,6 +48,8 @@ static GtkWidget *text = NULL;
static
gint
ret
=
YAD_RESPONSE_ESC
;
static
gboolean
is_x11
=
FALSE
;
YadNTabs
*
tabs
;
#ifndef G_OS_WIN32
...
...
@@ -556,9 +558,8 @@ create_dialog (void)
gtk_window_fullscreen
(
GTK_WINDOW
(
dlg
));
}
#ifdef GDK_WINDOWING_X11
/* print xid */
if
(
options
.
print_xid
)
if
(
is_x11
&&
options
.
print_xid
)
{
FILE
*
xf
;
...
...
@@ -577,7 +578,6 @@ create_dialog (void)
fflush
(
xf
);
}
}
#endif
return
dlg
;
}
...
...
@@ -725,6 +725,12 @@ main (gint argc, gchar ** argv)
}
yad_set_mode
();
/* check for current GDK backend */
#ifdef GDK_WINDOWING_X11
if
(
GDK_IS_X11_DISPLAY
(
gdk_display_get_default
()))
is_x11
=
TRUE
;
#endif
/* parse custom gtkrc */
if
(
options
.
gtkrc_file
)
{
...
...
@@ -792,14 +798,12 @@ main (gint argc, gchar ** argv)
signal
(
SIGUSR2
,
sa_usr2
);
#endif
#ifndef GDK_WINDOWING_X11
if
(
options
.
plug
!=
-
1
)
if
(
!
is_x11
&&
options
.
plug
!=
-
1
)
{
options
.
plug
=
-
1
;
if
(
options
.
debug
)
g_printerr
(
"YAD: WARNING: --plug mode not supported outside X11"
);
}
#endif
/* plug mode */
if
(
options
.
plug
!=
-
1
)
...
...
@@ -810,7 +814,8 @@ main (gint argc, gchar ** argv)
return
ret
;
}
#ifndef GDK_WINDOWING_X11
if
(
!
is_x11
)
{
if
(
options
.
mode
==
YAD_MODE_NOTEBOOK
||
options
.
mode
==
YAD_MODE_PANED
#ifdef HAVE_TRAY
||
options
.
mode
==
YAD_MODE_NOTIFICATION
...
...
@@ -820,7 +825,7 @@ main (gint argc, gchar ** argv)
g_printerr
(
"This mode not supported outside X11"
);
return
1
;
}
#endif
}
switch
(
options
.
mode
)
{
...
...
@@ -857,11 +862,12 @@ main (gint argc, gchar ** argv)
default:
dialog
=
create_dialog
();
#ifdef GDK_WINDOWING_X11
if
(
is_x11
)
{
/* add YAD_XID variable */
str
=
g_strdup_printf
(
"0x%X"
,
(
guint
)
GDK_WINDOW_XID
(
gtk_widget_get_window
(
dialog
)));
g_setenv
(
"YAD_XID"
,
str
,
TRUE
);
#endif
}
/* make some specific init actions */
if
(
options
.
mode
==
YAD_MODE_NOTEBOOK
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment